Repository: robb/Cartography Branch: master Commit: 462d6bbf365b Files: 63 Total size: 243.4 KB Directory structure: gitextract_o95d9xrv/ ├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── Cartography/ │ ├── Align.swift │ ├── AutoresizingMaskLayoutProxy.swift │ ├── Cartography.h │ ├── Coefficients.swift │ ├── Compound.swift │ ├── Constrain.swift │ ├── Constraint.swift │ ├── ConstraintGroup.swift │ ├── Context.swift │ ├── Dimension.swift │ ├── Distribute.swift │ ├── Edge.swift │ ├── Edges.swift │ ├── Expression.swift │ ├── Extensions.swift │ ├── Info.plist │ ├── LayoutGuide.swift │ ├── LayoutGuideProxy.swift │ ├── LayoutItem.swift │ ├── LayoutProxy+TypeErasure.swift │ ├── LayoutProxy.swift │ ├── LayoutSupport.swift │ ├── LayoutSupportProxy.swift │ ├── Point.swift │ ├── Priority.swift │ ├── Property.swift │ ├── Size.swift │ ├── View.swift │ └── ViewProxy.swift ├── Cartography.podspec ├── Cartography.xcodeproj/ │ ├── project.pbxproj │ ├── project.xcworkspace/ │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata/ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata/ │ └── xcschemes/ │ ├── Cartography-Mac.xcscheme │ ├── Cartography-iOS.xcscheme │ └── Cartography-tvOS.xcscheme ├── Cartography.xcworkspace/ │ ├── contents.xcworkspacedata │ └── xcshareddata/ │ └── IDEWorkspaceChecks.plist ├── CartographyTests/ │ ├── AlignSpec.swift │ ├── ConstraintGroupSpec.swift │ ├── DimensionSpec.swift │ ├── DistributeSpec.swift │ ├── EdgeSpec.swift │ ├── EdgesSpec.swift │ ├── Info.plist │ ├── LayoutGuideSpec.swift │ ├── LayoutSupportSpec.swift │ ├── Matchers.swift │ ├── MemoryLeakSpec.swift │ ├── PointSpec.swift │ ├── PrioritySpec.swift │ ├── SizeSpec.swift │ ├── TestView.swift │ ├── ViewHierarchySpec.swift │ ├── ViewLayoutGuideSpec.swift │ └── ViewProxyTests.swift ├── LICENSE ├── Package.swift ├── Podfile └── README.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ build/ *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata *.xccheckout *.moved-aside DerivedData *.hmap *.ipa *.xcuserstate Pods/ .DS_Store ================================================ FILE: .travis.yml ================================================ language: objective-c osx_image: xcode10.2 install: - gem install xcpretty - gem install cocoapods --pre script: - pod update - set -o pipefail && xcodebuild -workspace Cartography.xcworkspace -scheme 'Cartography-Mac' test | xcpretty -c - set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace ./Cartography.xcworkspace -scheme Cartography-iOS -destination 'platform=iOS Simulator,name=iPhone 6s Plus' build test | xcpretty env: global: secure: odPR+Uvp5Enxc8qlFxuUo+aYVf1zS9xF7t2at4IXAJtP0wegwmG8dYOZ5IiMZP/gbBtAWWYc2en4NVnqS9K9wPFIrKdShMwBGnRcsYPj3b6kH/vQM/OLwzYFit2oSqhR3n4RP5UM+lc4jJnfqrK7StMY6ZxCkvLdZkMbFGqVJ20= ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Code of Conduct As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team. This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. This Code of Conduct is adapted from the [Contributor Covenant, version 1.1.0](http://contributor- covenant.org/version/1/1/0/) ================================================ FILE: Cartography/Align.swift ================================================ // // Align.swift // Cartography // // Created by Robert Böhnke on 17/02/15. // Copyright (c) 2015 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit #else import AppKit #endif private func makeEqual(by attribute: (T) -> P, items: [T]) -> [NSLayoutConstraint] { if let first = items.first { if let first = first as? AutoresizingMaskLayoutProxy { first.translatesAutoresizingMaskIntoConstraints = false } let rest = items.dropFirst() return rest.reduce([]) { acc, current in if let current = current as? AutoresizingMaskLayoutProxy { current.translatesAutoresizingMaskIntoConstraints = false } return acc + [ attribute(first) == attribute(current) ] } } else { return [] } } /// Aligns multiple items by their top edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter items: an array of items to align /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(top items: [SupportsTopLayoutProxy]) -> [NSLayoutConstraint] { return makeEqual(by: { $0.top }, items: items.map(AnyTopLayoutProxy.init)) } /// Aligns multiple items by their top edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(top first: SupportsTopLayoutProxy, _ rest: SupportsTopLayoutProxy...) -> [NSLayoutConstraint] { return align(top: [first] + rest) } /// Aligns multiple items by their right edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter items: an array of items to align /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(right items: [SupportsRightLayoutProxy]) -> [NSLayoutConstraint] { return makeEqual(by: { $0.right }, items: items.map(AnyRightLayoutProxy.init)) } /// Aligns multiple items by their right edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(right first: SupportsRightLayoutProxy, _ rest: SupportsRightLayoutProxy...) -> [NSLayoutConstraint] { return align(right: [first] + rest) } /// Aligns multiple items by their bottom edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter items: an array of items to align /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(bottom items: [SupportsBottomLayoutProxy]) -> [NSLayoutConstraint] { return makeEqual(by: { $0.bottom }, items: items.map(AnyBottomLayoutProxy.init)) } /// Aligns multiple items by their bottom edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(bottom first: SupportsBottomLayoutProxy, _ rest: SupportsBottomLayoutProxy...) -> [NSLayoutConstraint] { return align(bottom: [first] + rest) } /// Aligns multiple items by their left edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter items: an array of items to align /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(left items: [SupportsLeftLayoutProxy]) -> [NSLayoutConstraint] { return makeEqual(by: { $0.left }, items: items.map(AnyLeftLayoutProxy.init)) } /// Aligns multiple items by their left edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(left first: SupportsLeftLayoutProxy, _ rest: SupportsLeftLayoutProxy...) -> [NSLayoutConstraint] { return align(left: [first] + rest) } /// Aligns multiple items by their leading edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter items: an array of items to align /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(leading items: [SupportsLeadingLayoutProxy]) -> [NSLayoutConstraint] { return makeEqual(by: { $0.leading }, items: items.map(AnyLeadingLayoutProxy.init)) } /// Aligns multiple items by their leading edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(leading first: SupportsLeadingLayoutProxy, _ rest: SupportsLeadingLayoutProxy...) -> [NSLayoutConstraint] { return align(leading: [first] + rest) } /// Aligns multiple items by their trailing edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter items: an array of items to align /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(trailing items: [SupportsTrailingLayoutProxy]) -> [NSLayoutConstraint] { return makeEqual(by: { $0.trailing }, items: items.map(AnyTrailingLayoutProxy.init)) } /// Aligns multiple vies by their trailing edge. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(trailing first: SupportsTrailingLayoutProxy, _ rest: SupportsTrailingLayoutProxy...) -> [NSLayoutConstraint] { return align(trailing: [first] + rest) } /// Aligns multiple items by their horizontal center. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter items: an array of items to align /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(centerX items: [SupportsCenterXLayoutProxy]) -> [NSLayoutConstraint] { return makeEqual(by: { $0.centerX }, items: items.map(AnyCenterXLayoutProxy.init)) } /// Aligns multiple items by their horizontal center. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(centerX first: SupportsCenterXLayoutProxy, _ rest: SupportsCenterXLayoutProxy...) -> [NSLayoutConstraint] { return align(centerX: [first] + rest) } /// Aligns multiple items by their vertical center. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter items: an array of items to align /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(centerY items: [SupportsCenterYLayoutProxy]) -> [NSLayoutConstraint] { return makeEqual(by: { $0.centerY }, items: items.map(AnyCenterYLayoutProxy.init)) } /// Aligns multiple items by their vertical center. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(centerY first: SupportsCenterYLayoutProxy, _ rest: SupportsCenterYLayoutProxy...) -> [NSLayoutConstraint] { return align(centerY: [first] + rest) } /// Aligns multiple items by their baseline. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter items: an array of items to align /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(baseline items: [SupportsBaselineLayoutProxy]) -> [NSLayoutConstraint] { return makeEqual(by: { $0.baseline }, items: items.map(AnyBaselineLayoutProxy.init)) } /// Aligns multiple items by their baseline. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func align(baseline first: SupportsBaselineLayoutProxy, _ rest: SupportsBaselineLayoutProxy...) -> [NSLayoutConstraint] { return align(baseline: [first] + rest) } ================================================ FILE: Cartography/AutoresizingMaskLayoutProxy.swift ================================================ // // AutoresizingMaskLayoutProxy.swift // Cartography-iOS // // Created by Vitor Travain on 24/10/17. // Copyright © 2017 Robert Böhnke. All rights reserved. // import Foundation public protocol AutoresizingMaskLayoutProxy: LayoutProxy { var translatesAutoresizingMaskIntoConstraints: Bool { get set } } ================================================ FILE: Cartography/Cartography.h ================================================ // // Cartography.h // Cartography // // Created by Robert Böhnke on 17/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // #import #if TARGET_OS_IPHONE || TARGET_OS_TV #import #else #import #endif //! Project version number for Cartography. FOUNDATION_EXPORT double CartographyVersionNumber; //! Project version string for Cartography. FOUNDATION_EXPORT const unsigned char CartographyVersionString[]; ================================================ FILE: Cartography/Coefficients.swift ================================================ // // Coefficients.swift // Cartography // // Created by Robert Böhnke on 17/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // import Foundation #if os(iOS) || os(tvOS) import UIKit #endif public struct Coefficients { var multiplier: CGFloat = 1 var constant: CGFloat = 0 init() { } init(_ multiplier: CGFloat, _ constant: CGFloat) { self.constant = constant self.multiplier = multiplier } } // MARK: Addition public func + (c: CGFloat, rhs: Coefficients) -> Coefficients { return Coefficients(rhs.multiplier, rhs.constant + c) } public func + (lhs: Coefficients, rhs: CGFloat) -> Coefficients { return rhs + lhs } // MARK: Subtraction public func - (c: CGFloat, rhs: Coefficients) -> Coefficients { return Coefficients(rhs.multiplier, rhs.constant - c) } public func - (lhs: Coefficients, rhs: CGFloat) -> Coefficients { return rhs - lhs } // MARK: Multiplication public func * (m: CGFloat, rhs: Coefficients) -> Coefficients { return Coefficients(rhs.multiplier * m, rhs.constant * m) } public func * (lhs: Coefficients, rhs: CGFloat) -> Coefficients { return rhs * lhs } // MARK: Division public func / (m: CGFloat, rhs: Coefficients) -> Coefficients { return Coefficients(rhs.multiplier / m, rhs.constant / m) } public func / (lhs: Coefficients, rhs: CGFloat) -> Coefficients { return rhs / lhs } ================================================ FILE: Cartography/Compound.swift ================================================ // // Compound.swift // Cartography // // Created by Robert Böhnke on 18/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit #else import AppKit #endif public protocol Compound { var context: Context { get } var properties: [Property] { get } } /// Compound properties conforming to this protocol can use the `==` operator /// with other compound properties of the same type. public protocol RelativeCompoundEquality : Compound { } /// Declares a property equal to a the result of an expression. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The expression. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func == (lhs: P, rhs: Expression

) -> [NSLayoutConstraint] { return lhs.context.addConstraint(lhs, coefficients: rhs.coefficients, to: rhs.value) } /// Declares a property equal to another compound property. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The other property. /// @discardableResult public func == (lhs: P, rhs: P) -> [NSLayoutConstraint] { return lhs.context.addConstraint(lhs, to: rhs) } /// Compound properties conforming to this protocol can use the `<=` and `>=` /// operators with other compound properties of the same type. public protocol RelativeCompoundInequality : Compound { } /// Declares a property less than or equal to another compound property. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The other property. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func <= (lhs: P, rhs: P) -> [NSLayoutConstraint] { return lhs.context.addConstraint(lhs, to: rhs, relation: .lessThanOrEqual) } /// Declares a property greater than or equal to another compound property. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The other property. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func >= (lhs: P, rhs: P) -> [NSLayoutConstraint] { return lhs.context.addConstraint(lhs, to: rhs, relation: .greaterThanOrEqual) } /// Declares a property less than or equal to the result of an expression. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The other property. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func <= (lhs: P, rhs: Expression

) -> [NSLayoutConstraint] { return lhs.context.addConstraint(lhs, coefficients: rhs.coefficients, to: rhs.value, relation: .lessThanOrEqual) } /// Declares a property greater than or equal to the result of an expression. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The other property. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func >= (lhs: P, rhs: Expression

) -> [NSLayoutConstraint] { return lhs.context.addConstraint(lhs, coefficients: rhs.coefficients, to: rhs.value, relation: .greaterThanOrEqual) } ================================================ FILE: Cartography/Constrain.swift ================================================ // // Constrain.swift // Cartography // // Created by Robert Böhnke on 30/09/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // import Foundation /// Removes all constraints for a group. /// /// - parameter clear: The `ConstraintGroup` whose constraints should be removed. /// public func constrain(clear group: ConstraintGroup) { group.replaceConstraints([]) } /// Updates the constraints of a single layout item. /// /// - parameter item: The item to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `item`. /// @discardableResult public func constrain(_ item: A, replace group: ConstraintGroup = .init(), block: (A.ProxyType) -> Void) -> ConstraintGroup { let proxy = item.asProxy() block(proxy) group.replaceConstraints(proxy.context.constraints) return group } /// Updates the constraints of two layout items. /// /// - parameter item1: An item to layout. /// - parameter item2: An item to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `item`. /// @discardableResult public func constrain(_ item1: A, _ item2: B, replace group: ConstraintGroup = .init(), block: (A.ProxyType, B.ProxyType) -> Void) -> ConstraintGroup { let ctx = Context() let proxy1 = item1.asProxy(context: ctx) let proxy2 = item2.asProxy(context: ctx) block(proxy1, proxy2) group.replaceConstraints(ctx.constraints) return group } /// Updates the constraints of three layout items. /// /// - parameter item1: An item to layout. /// - parameter item2: An item to layout. /// - parameter item3: An item to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `item`. /// @discardableResult public func constrain(_ item1: A, _ item2: B, _ item3: C, replace group: ConstraintGroup = .init(), block: (A.ProxyType, B.ProxyType, C.ProxyType) -> Void) -> ConstraintGroup { let ctx = Context() let proxy1 = item1.asProxy(context: ctx) let proxy2 = item2.asProxy(context: ctx) let proxy3 = item3.asProxy(context: ctx) block(proxy1, proxy2, proxy3) group.replaceConstraints(ctx.constraints) return group } /// Updates the constraints of four layout items. /// /// - parameter item1: An item to layout. /// - parameter item2: An item to layout. /// - parameter item3: An item to layout. /// - parameter item4: An item to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `item`. /// @discardableResult public func constrain(_ item1: A, _ item2: B, _ item3: C, _ item4: D, replace group: ConstraintGroup = .init(), block: (A.ProxyType, B.ProxyType, C.ProxyType, D.ProxyType) -> Void) -> ConstraintGroup { let ctx = Context() let proxy1 = item1.asProxy(context: ctx) let proxy2 = item2.asProxy(context: ctx) let proxy3 = item3.asProxy(context: ctx) let proxy4 = item4.asProxy(context: ctx) block(proxy1, proxy2, proxy3, proxy4) group.replaceConstraints(ctx.constraints) return group } /// Updates the constraints of five layout items. /// /// - parameter item1: An item to layout. /// - parameter item2: An item to layout. /// - parameter item3: An item to layout. /// - parameter item4: An item to layout. /// - parameter item5: An item to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `item`. /// @discardableResult public func constrain(_ item1: A, _ item2: B, _ item3: C, _ item4: D, _ item5: E, replace group: ConstraintGroup = .init(), block: (A.ProxyType, B.ProxyType, C.ProxyType, D.ProxyType, E.ProxyType) -> Void) -> ConstraintGroup { let ctx = Context() let proxy1 = item1.asProxy(context: ctx) let proxy2 = item2.asProxy(context: ctx) let proxy3 = item3.asProxy(context: ctx) let proxy4 = item4.asProxy(context: ctx) let proxy5 = item5.asProxy(context: ctx) block(proxy1, proxy2, proxy3, proxy4, proxy5) group.replaceConstraints(ctx.constraints) return group } /// Updates the constraints of six layout items. /// /// - parameter item1: An item to layout. /// - parameter item2: An item to layout. /// - parameter item3: An item to layout. /// - parameter item4: An item to layout. /// - parameter item5: An item to layout. /// - parameter item6: An item to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `item`. /// @discardableResult public func constrain(_ item1: A, _ item2: B, _ item3: C, _ item4: D, _ item5: E, _ item6: F, replace group: ConstraintGroup = .init(), block: (A.ProxyType, B.ProxyType, C.ProxyType, D.ProxyType, E.ProxyType, F.ProxyType) -> Void) -> ConstraintGroup { let ctx = Context() let proxy1 = item1.asProxy(context: ctx) let proxy2 = item2.asProxy(context: ctx) let proxy3 = item3.asProxy(context: ctx) let proxy4 = item4.asProxy(context: ctx) let proxy5 = item5.asProxy(context: ctx) let proxy6 = item6.asProxy(context: ctx) block(proxy1, proxy2, proxy3, proxy4, proxy5, proxy6) group.replaceConstraints(ctx.constraints) return group } /// Updates the constraints of seven layout items. /// /// - parameter item1: An item to layout. /// - parameter item2: An item to layout. /// - parameter item3: An item to layout. /// - parameter item4: An item to layout. /// - parameter item5: An item to layout. /// - parameter item6: An item to layout. /// - parameter item7: An item to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `item`. /// @discardableResult public func constrain(_ item1: A, _ item2: B, _ item3: C, _ item4: D, _ item5: E, _ item6: F, _ item7: G, replace group: ConstraintGroup = .init(), block: (A.ProxyType, B.ProxyType, C.ProxyType, D.ProxyType, E.ProxyType, F.ProxyType, G.ProxyType) -> Void) -> ConstraintGroup { let ctx = Context() let proxy1 = item1.asProxy(context: ctx) let proxy2 = item2.asProxy(context: ctx) let proxy3 = item3.asProxy(context: ctx) let proxy4 = item4.asProxy(context: ctx) let proxy5 = item5.asProxy(context: ctx) let proxy6 = item6.asProxy(context: ctx) let proxy7 = item7.asProxy(context: ctx) block(proxy1, proxy2, proxy3, proxy4, proxy5, proxy6, proxy7) group.replaceConstraints(ctx.constraints) return group } /// Updates the constraints of eight layout items. /// /// - parameter item1: An item to layout. /// - parameter item2: An item to layout. /// - parameter item3: An item to layout. /// - parameter item4: An item to layout. /// - parameter item5: An item to layout. /// - parameter item6: An item to layout. /// - parameter item7: An item to layout. /// - parameter item8: An item to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `item`. /// @discardableResult public func constrain(_ item1: A, _ item2: B, _ item3: C, _ item4: D, _ item5: E, _ item6: F, _ item7: G, _ item8: H, replace group: ConstraintGroup = .init(), block: (A.ProxyType, B.ProxyType, C.ProxyType, D.ProxyType, E.ProxyType, F.ProxyType, G.ProxyType, H.ProxyType) -> Void) -> ConstraintGroup { let ctx = Context() let proxy1 = item1.asProxy(context: ctx) let proxy2 = item2.asProxy(context: ctx) let proxy3 = item3.asProxy(context: ctx) let proxy4 = item4.asProxy(context: ctx) let proxy5 = item5.asProxy(context: ctx) let proxy6 = item6.asProxy(context: ctx) let proxy7 = item7.asProxy(context: ctx) let proxy8 = item8.asProxy(context: ctx) block(proxy1, proxy2, proxy3, proxy4, proxy5, proxy6, proxy7, proxy8) group.replaceConstraints(ctx.constraints) return group } /// Updates the constraints of nine layout items. /// /// - parameter item1: An item to layout. /// - parameter item2: An item to layout. /// - parameter item3: An item to layout. /// - parameter item4: An item to layout. /// - parameter item5: An item to layout. /// - parameter item6: An item to layout. /// - parameter item7: An item to layout. /// - parameter item8: An item to layout. /// - parameter item9: An item to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `item`. /// @discardableResult public func constrain(_ item1: A, _ item2: B, _ item3: C, _ item4: D, _ item5: E, _ item6: F, _ item7: G, _ item8: H, _ item9: I, replace group: ConstraintGroup = .init(), block: (A.ProxyType, B.ProxyType, C.ProxyType, D.ProxyType, E.ProxyType, F.ProxyType, G.ProxyType, H.ProxyType, I.ProxyType) -> Void) -> ConstraintGroup { let ctx = Context() let proxy1 = item1.asProxy(context: ctx) let proxy2 = item2.asProxy(context: ctx) let proxy3 = item3.asProxy(context: ctx) let proxy4 = item4.asProxy(context: ctx) let proxy5 = item5.asProxy(context: ctx) let proxy6 = item6.asProxy(context: ctx) let proxy7 = item7.asProxy(context: ctx) let proxy8 = item8.asProxy(context: ctx) let proxy9 = item9.asProxy(context: ctx) block(proxy1, proxy2, proxy3, proxy4, proxy5, proxy6, proxy7, proxy8, proxy9) group.replaceConstraints(ctx.constraints) return group } /// Updates the constraints of ten layout items. /// /// - parameter item1: An item to layout. /// - parameter item2: An item to layout. /// - parameter item3: An item to layout. /// - parameter item4: An item to layout. /// - parameter item5: An item to layout. /// - parameter item6: An item to layout. /// - parameter item7: An item to layout. /// - parameter item8: An item to layout. /// - parameter item9: An item to layout. /// - parameter item10: An item to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `item`. /// @discardableResult public func constrain(_ item1: A, _ item2: B, _ item3: C, _ item4: D, _ item5: E, _ item6: F, _ item7: G, _ item8: H, _ item9: I, _ item10: J, replace group: ConstraintGroup = .init(), block: (A.ProxyType, B.ProxyType, C.ProxyType, D.ProxyType, E.ProxyType, F.ProxyType, G.ProxyType, H.ProxyType, I.ProxyType, J.ProxyType) -> Void) -> ConstraintGroup { let ctx = Context() let proxy1 = item1.asProxy(context: ctx) let proxy2 = item2.asProxy(context: ctx) let proxy3 = item3.asProxy(context: ctx) let proxy4 = item4.asProxy(context: ctx) let proxy5 = item5.asProxy(context: ctx) let proxy6 = item6.asProxy(context: ctx) let proxy7 = item7.asProxy(context: ctx) let proxy8 = item8.asProxy(context: ctx) let proxy9 = item9.asProxy(context: ctx) let proxy10 = item10.asProxy(context: ctx) block(proxy1, proxy2, proxy3, proxy4, proxy5, proxy6, proxy7, proxy8, proxy9, proxy10) group.replaceConstraints(ctx.constraints) return group } /// Updates the constraints of an array of layout items. /// /// - parameter items: The items to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `items`. /// @discardableResult public func constrain(_ items: [T], replace group: ConstraintGroup = .init(), block: ([T.ProxyType]) -> Void) -> ConstraintGroup { let ctx = Context() let proxy = items.map { $0.asProxy(context: ctx) } block(proxy) group.replaceConstraints(ctx.constraints) return group } /// Updates the constraints of a dictionary of layout items. /// /// - parameter items: The items to layout. /// - parameter replace: The `ConstraintGroup` whose constraints should be /// replaced. /// - parameter block: A block that declares the layout for `items`. /// @discardableResult public func constrain(_ items: [T: U], replace group: ConstraintGroup = .init(), block: ([T: U.ProxyType]) -> Void) -> ConstraintGroup { let ctx = Context() let proxy: [T: U.ProxyType] = items.mapValues { $0.asProxy(context: ctx) } block(proxy) group.replaceConstraints(ctx.constraints) return group } ================================================ FILE: Cartography/Constraint.swift ================================================ // // Constraint.swift // Cartography // // Created by Robert Böhnke on 06/10/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit #else import AppKit #endif internal class Constraint { let layoutConstraint: NSLayoutConstraint func install() { layoutConstraint.isActive = true } func uninstall() { layoutConstraint.isActive = false } init(_ layoutConstraint: NSLayoutConstraint) { self.layoutConstraint = layoutConstraint } } ================================================ FILE: Cartography/ConstraintGroup.swift ================================================ // // ConstraintGroup.swift // Cartography // // Created by Robert Böhnke on 22/01/15. // Copyright (c) 2015 Robert Böhnke. All rights reserved. // import Foundation public class ConstraintGroup { private var constraints: [Constraint] = [] @available(OSX, introduced: 10.10) @available(iOS, introduced: 8.0) public var active: Bool { get { return constraints .map { $0.layoutConstraint.isActive } .reduce(true) { $0 && $1 } } set { for constraint in constraints { constraint.layoutConstraint.isActive = newValue } } } public init() { } internal func replaceConstraints(_ constraints: [Constraint]) { for constraint in self.constraints { constraint.uninstall() } self.constraints = constraints for constraint in self.constraints { constraint.install() } } } ================================================ FILE: Cartography/Context.swift ================================================ // // Context.swift // Cartography // // Created by Robert Böhnke on 06/10/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit public typealias LayoutRelation = NSLayoutConstraint.Relation #else import AppKit public typealias LayoutRelation = NSLayoutConstraint.Relation #endif public class Context { internal var constraints: [Constraint] = [] internal func addConstraint(_ from: Property, to: Property? = nil, coefficients: Coefficients = Coefficients(), relation: LayoutRelation = .equal) -> NSLayoutConstraint { if let fromItem = from.item as? View { fromItem.translatesAutoresizingMaskIntoConstraints = false } let layoutConstraint = NSLayoutConstraint(item: from.item, attribute: from.attribute, relatedBy: relation, toItem: to?.item, attribute: to?.attribute ?? .notAnAttribute, multiplier: CGFloat(coefficients.multiplier), constant: CGFloat(coefficients.constant)) constraints.append(Constraint(layoutConstraint)) return layoutConstraint } internal func addConstraint(_ from: Compound, coefficients: [Coefficients]? = nil, to: Compound? = nil, relation: LayoutRelation = .equal) -> [NSLayoutConstraint] { var results: [NSLayoutConstraint] = [] for i in 0..(_ items: [T], combine: (T, T) -> NSLayoutConstraint) -> [NSLayoutConstraint] { if let last = items.last as? AutoresizingMaskLayoutProxy { last.translatesAutoresizingMaskIntoConstraints = false } if let first = items.first { let rest = items.dropFirst() return rest.reduce(([], first)) { (acc, current) -> ([NSLayoutConstraint], T) in let (constraints, previous) = acc return (constraints + [ combine(previous, current) ], current) }.0 } else { return [] } } /// Distributes multiple items horizontally. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter amount: The distance between the items. /// - parameter items: An array of items to distribute. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func distribute(by amount: CGFloat = 0.0, horizontally items: [SupportsLeadingLayoutProxy & SupportsTrailingLayoutProxy]) -> [NSLayoutConstraint] { return reduce(items.map(AnyHorizontalDistributionLayoutProxy.init)) { return $0.trailing == $1.leading - amount } } /// Distributes multiple items horizontally. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter amount: The distance between the items. /// - parameter items: The items to distribute. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func distribute(by amount: CGFloat = 0.0, horizontally first: SupportsLeadingLayoutProxy & SupportsTrailingLayoutProxy, _ rest: (SupportsLeadingLayoutProxy & SupportsTrailingLayoutProxy)...) -> [NSLayoutConstraint] { return distribute(by: amount, horizontally: [first] + rest) } /// Distributes multiple items horizontally from left to right. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter amount: The distance between the items. /// - parameter items: An array of items to distribute. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func distribute(by amount: CGFloat = 0.0, leftToRight items: [SupportsLeftLayoutProxy & SupportsRightLayoutProxy]) -> [NSLayoutConstraint] { return reduce(items.map(AnyLeftToRightDistributionLayoutProxy.init)) { return $0.right == $1.left - amount } } /// Distributes multiple items horizontally from left to right. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter amount: The distance between the items. /// - parameter items: The items to distribute. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func distribute(by amount: CGFloat = 0.0, leftToRight first: SupportsLeftLayoutProxy & SupportsRightLayoutProxy, _ rest: (SupportsLeftLayoutProxy & SupportsRightLayoutProxy)...) -> [NSLayoutConstraint] { return distribute(by: amount, leftToRight: [first] + rest) } /// Distributes multiple items vertically. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter amount: The distance between the items. /// - parameter items: An array of items to distribute. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func distribute(by amount: CGFloat = 0.0, vertically items: [SupportsTopLayoutProxy & SupportsBottomLayoutProxy]) -> [NSLayoutConstraint] { return reduce(items.map(AnyVerticalDistributionLayoutProxy.init)) { return $0.bottom == $1.top - amount } } /// Distributes multiple items vertically. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - parameter amount: The distance between the items. /// - parameter items: The items to distribute. /// /// - returns: An array of `NSLayoutConstraint` instances. /// @discardableResult public func distribute(by amount: CGFloat = 0.0, vertically first: SupportsTopLayoutProxy & SupportsBottomLayoutProxy, _ rest: (SupportsTopLayoutProxy & SupportsBottomLayoutProxy)...) -> [NSLayoutConstraint] { return distribute(by: amount, vertically: [first] + rest) } /// Distributes width for all the items. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - Parameter items: The items to distribute /// /// - Returns: An array of `NSLayoutConstraint` instances /// @discardableResult public func distribute(equalWidth items: [SupportsWidthLayoutProxy]) -> [NSLayoutConstraint] { return reduce(items.map(AnyWidthLayoutProxy.init)) { $0.width == $1.width } } /// Distributes width for all the items. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - Parameter items: The items to distribute /// /// - Returns: An array of `NSLayoutConstraint` instances /// @discardableResult public func distribute(equalWidth first: SupportsWidthLayoutProxy, _ rest: (SupportsWidthLayoutProxy)...) -> [NSLayoutConstraint] { return distribute(equalWidth: [first] + rest) } /// Distributes height for all the items. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - Parameter items: The items to distribute /// /// - Returns: An array of `NSLayoutConstraint` instances /// @discardableResult public func distribute(equalHeight items: [SupportsHeightLayoutProxy]) -> [NSLayoutConstraint] { return reduce(items.map(AnyHeightLayoutProxy.init)) { $0.height == $1.height } } /// Distributes height for all the items. /// /// All items passed to this function will have /// their `translatesAutoresizingMaskIntoConstraints` properties set to `false`. /// /// - Parameter items: The items to distribute /// /// - Returns: An array of `NSLayoutConstraint` instances /// @discardableResult public func distribute(equalHeight first: SupportsHeightLayoutProxy, _ rest: (SupportsHeightLayoutProxy)...) -> [NSLayoutConstraint] { return distribute(equalHeight: [first] + rest) } ================================================ FILE: Cartography/Edge.swift ================================================ // // Edge.swift // Cartography // // Created by Robert Böhnke on 17/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit #else import AppKit #endif public struct Edge : Property, RelativeEquality, RelativeInequality, Addition, Multiplication { public let attribute: LayoutAttribute public let context: Context public let item: AnyObject internal init(_ context: Context, _ item: AnyObject, _ attribute: LayoutAttribute) { self.attribute = attribute self.context = context self.item = item } } ================================================ FILE: Cartography/Edges.swift ================================================ // // Edges.swift // Cartography // // Created by Robert Böhnke on 19/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit #else import AppKit #endif public struct Edges: Compound, RelativeCompoundEquality, RelativeCompoundInequality { public let context: Context public let properties: [Property] internal init(_ context: Context, _ properties: [Property]) { guard properties.count == 4 else { fatalError("No valid edges were used") } self.context = context self.properties = properties } /// Insets all edges individually. /// /// - parameter top: The amount by which to inset the top edge, in points. /// - parameter leading: The amount by which to inset the leading edge, in points. /// - parameter bottom: The amount by which to inset the bottom edge, in points. /// - parameter trailing: The amount by which to inset the trailing edge, in points. /// /// - returns: A new expression with the inseted edges. /// public func inseted(top: CGFloat, leading: CGFloat, bottom: CGFloat, trailing: CGFloat) -> Expression { return Expression( self, [ Coefficients(1, top), Coefficients(1, leading), Coefficients(1, -bottom), Coefficients(1, -trailing) ] ) } /// Insets all horizontal and vertical edges. /// /// - parameter horizontally: The amount by which to inset the leading and trailing edges, in points. /// - parameter vertically: The amount by which to inset the top and bottom edges, in points. /// /// - returns: A new expression with the inseted edges. /// public func inseted(horizontally: CGFloat, vertically: CGFloat) -> Expression { return self.inseted( top: vertically, leading: horizontally, bottom: vertically, trailing: horizontally ) } /// Insets all horizontal edges. /// /// - parameter horizontally: The amount by which to inset the leading and trailing edges, in points. /// /// - returns: A new expression with the inseted edges. /// public func inseted(horizontally: CGFloat) -> Expression { return self.inseted( horizontally: horizontally, vertically: 0 ) } /// Insets all vertical edges. /// /// - parameter vertically: The amount by which to inset the top and bottom edges, in points. /// /// - returns: A new expression with the inseted edges. /// public func inseted(vertically: CGFloat) -> Expression { return self.inseted( horizontally: 0, vertically: vertically ) } /// Insets all edges by a single value. /// /// - parameter by: The amount by which to inset the top and bottom edges, in points. /// /// - returns: A new expression with the inseted edges. /// public func inseted(by value: CGFloat) -> Expression { return self.inseted( horizontally: value, vertically: value ) } #if os(iOS) || os(tvOS) /// Insets all edges individually using an existing UIEdgeInsets. /// /// - parameter by: The UIEdgeInsets to use as a base value. /// /// - returns: A new expression with the inseted edges. /// public func inseted(by insets: UIEdgeInsets) -> Expression { return self.inseted( top: insets.top, leading: insets.left, bottom: insets.bottom, trailing: insets.right ) } #endif } /// Insets all edges. /// /// - parameter edges: The edges to inset. /// - parameter all: The amount by which to inset all edges, in points. /// /// - returns: A new expression with the inset edges. /// public func inset(_ edges: Edges, _ all: CGFloat) -> Expression { return edges.inseted(by: all) } /// Insets the horizontal and vertical edges. /// /// - parameter edges: The edges to inset. /// - parameter horizontal: The amount by which to inset the horizontal edges, in /// points. /// - parameter vertical: The amount by which to inset the vertical edges, in /// points. /// /// - returns: A new expression with the inset edges. /// public func inset(_ edges: Edges, _ horizontal: CGFloat, _ vertical: CGFloat) -> Expression { return edges.inseted(horizontally: horizontal, vertically: vertical) } /// Insets the horizontal edges. /// /// - parameter edges: The edges to inset. /// - parameter horizontally: The amount by which to inset the horizontal edges, in /// points. /// /// - returns: A new expression with the inset edges. /// public func inset(_ edges: Edges, horizontally horizontal: CGFloat) -> Expression { return edges.inseted(horizontally: horizontal) } /// Insets the vertical edges. /// /// - parameter edges: The edges to inset. /// - parameter vertically: The amount by which to inset the vertical edges, in /// points. /// /// - returns: A new expression with the inset edges. /// public func inset(_ edges: Edges, vertically vertical: CGFloat) -> Expression { return edges.inseted(vertically: vertical) } /// Insets edges individually. /// /// - parameter edges: The edges to inset. /// - parameter top: The amount by which to inset the top edge, in points. /// - parameter leading: The amount by which to inset the leading edge, in points. /// - parameter bottom: The amount by which to inset the bottom edge, in points. /// - parameter trailing: The amount by which to inset the trailing edge, in points. /// /// - returns: A new expression with the inset edges. /// public func inset(_ edges: Edges, _ top: CGFloat, _ leading: CGFloat, _ bottom: CGFloat, _ trailing: CGFloat) -> Expression { return edges.inseted(top: top, leading: leading, bottom: bottom, trailing: trailing) } #if os(iOS) || os(tvOS) /// Insets edges individually with UIEdgeInset. /// /// - parameter edges: The edges to inset. /// - parameter insets: The amounts by which to inset all edges, in points via UIEdgeInsets. /// /// - returns: A new expression with the inset edges. /// public func inset(_ edges: Edges, _ insets: UIEdgeInsets) -> Expression { return edges.inseted(by: insets) } #endif ================================================ FILE: Cartography/Expression.swift ================================================ // // Expression.swift // Cartography // // Created by Robert Böhnke on 17/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // import Foundation public struct Expression { let value: T var coefficients: [Coefficients] init(_ value: T, _ coefficients: [Coefficients]) { assert(coefficients.count > 0) self.value = value self.coefficients = coefficients } } ================================================ FILE: Cartography/Extensions.swift ================================================ // // Extensions.swift // Cartography // // Created by Robert Böhnke on 22/01/15. // Copyright (c) 2015 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit #else import AppKit #endif internal extension Dictionary { init(_ pairs: [Element]) { self.init() for (key, value) in pairs { self[key] = value } } } ================================================ FILE: Cartography/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion ${CURRENT_PROJECT_VERSION} NSPrincipalClass ================================================ FILE: Cartography/LayoutGuide.swift ================================================ // // LayoutGuide.swift // Cartography // // Created by Vitor Travain on 11/10/17. // Copyright © 2017 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit @available(iOS, introduced: 9.0) @available(tvOS, introduced: 9.0) public typealias LayoutGuide = UILayoutGuide @available(iOS, introduced: 9.0) @available(tvOS, introduced: 9.0) extension UILayoutGuide: LayoutItem { @available(iOS, introduced: 9.0) @available(tvOS, introduced: 9.0) public func asProxy(context: Context) -> LayoutGuideProxy { return LayoutGuideProxy(context: context, item: self) } } #elseif os(OSX) import AppKit @available(OSX, introduced: 10.11) public typealias LayoutGuide = NSLayoutGuide @available(OSX, introduced: 10.11) extension NSLayoutGuide: LayoutItem { @available(OSX, introduced: 10.11) public func asProxy(context: Context) -> LayoutGuideProxy { return LayoutGuideProxy(context: context, item: self) } } #endif ================================================ FILE: Cartography/LayoutGuideProxy.swift ================================================ // // LayoutGuideProxy.swift // Cartography // // Created by Vitor Travain on 11/10/17. // Copyright © 2017 Robert Böhnke. All rights reserved. // @available(iOS, introduced: 9.0) @available(tvOS, introduced: 9.0) @available(OSX, introduced: 10.11) public final class LayoutGuideProxy: SupportsPositioningLayoutProxy { public let context: Context private let layoutGuide: LayoutGuide public var item: AnyObject { return layoutGuide } public init(context: Context, item: LayoutGuide) { self.context = context self.layoutGuide = item } public var owningView: ViewProxy? { return layoutGuide.owningView?.asProxy(context: context) } } ================================================ FILE: Cartography/LayoutItem.swift ================================================ // // LayoutItem.swift // Cartography-iOS // // Created by Vitor Travain on 10/10/17. // Copyright © 2017 Robert Böhnke. All rights reserved. // public protocol LayoutItem: AnyObject { associatedtype ProxyType: LayoutProxy func asProxy(context: Context) -> ProxyType } extension LayoutItem { public func asProxy() -> ProxyType { return asProxy(context: Context()) } } ================================================ FILE: Cartography/LayoutProxy+TypeErasure.swift ================================================ // // LayoutProxy+TypeErasure.swift // Cartography-iOS // // Created by Vitor Travain on 17/10/17. // Copyright © 2017 Robert Böhnke. All rights reserved. // import Foundation final class AnyTopLayoutProxy: SupportsTopLayoutProxy { let proxy: SupportsTopLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsTopLayoutProxy) { self.proxy = proxy } } final class AnyBottomLayoutProxy: SupportsBottomLayoutProxy { let proxy: SupportsBottomLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsBottomLayoutProxy) { self.proxy = proxy } } final class AnyLeftLayoutProxy: SupportsLeftLayoutProxy { let proxy: SupportsLeftLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsLeftLayoutProxy) { self.proxy = proxy } } final class AnyRightLayoutProxy: SupportsRightLayoutProxy { let proxy: SupportsRightLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsRightLayoutProxy) { self.proxy = proxy } } final class AnyLeadingLayoutProxy: SupportsLeadingLayoutProxy { let proxy: SupportsLeadingLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsLeadingLayoutProxy) { self.proxy = proxy } } final class AnyTrailingLayoutProxy: SupportsTrailingLayoutProxy { let proxy: SupportsTrailingLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsTrailingLayoutProxy) { self.proxy = proxy } } final class AnyCenterXLayoutProxy: SupportsCenterXLayoutProxy { let proxy: SupportsCenterXLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsCenterXLayoutProxy) { self.proxy = proxy } } final class AnyCenterYLayoutProxy: SupportsCenterYLayoutProxy { let proxy: SupportsCenterYLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsCenterYLayoutProxy) { self.proxy = proxy } } final class AnyBaselineLayoutProxy: SupportsBaselineLayoutProxy { let proxy: SupportsBaselineLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsBaselineLayoutProxy) { self.proxy = proxy } } final class AnyHorizontalDistributionLayoutProxy: SupportsLeadingLayoutProxy, SupportsTrailingLayoutProxy { let proxy: SupportsLeadingLayoutProxy & SupportsTrailingLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsLeadingLayoutProxy & SupportsTrailingLayoutProxy) { self.proxy = proxy } } final class AnyLeftToRightDistributionLayoutProxy: SupportsLeftLayoutProxy, SupportsRightLayoutProxy { let proxy: SupportsLeftLayoutProxy & SupportsRightLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsLeftLayoutProxy & SupportsRightLayoutProxy) { self.proxy = proxy } } final class AnyVerticalDistributionLayoutProxy: SupportsTopLayoutProxy, SupportsBottomLayoutProxy { let proxy: SupportsTopLayoutProxy & SupportsBottomLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsTopLayoutProxy & SupportsBottomLayoutProxy) { self.proxy = proxy } } final class AnyWidthLayoutProxy: SupportsWidthLayoutProxy { let proxy: SupportsWidthLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsWidthLayoutProxy) { self.proxy = proxy } } final class AnyHeightLayoutProxy: SupportsHeightLayoutProxy { let proxy: SupportsHeightLayoutProxy var context: Context { return proxy.context } var item: AnyObject { return proxy.item } init(_ proxy: SupportsHeightLayoutProxy) { self.proxy = proxy } } ================================================ FILE: Cartography/LayoutProxy.swift ================================================ // // LayoutProxy.swift // Cartography // // Created by Robert Böhnke on 17/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // import Foundation #if os(iOS) || os(tvOS) import UIKit #elseif os(OSX) import AppKit #endif public protocol LayoutProxy: AnyObject { var context: Context { get } var item: AnyObject { get } //type-erased Layoutitem } extension LayoutProxy { #if os(iOS) || os(tvOS) internal func dimension(with attribute: NSLayoutConstraint.Attribute) -> Dimension { return Dimension(context, item, attribute) } internal func edge(with attribute: NSLayoutConstraint.Attribute) -> Edge { return Edge(context, item, attribute) } #elseif os(OSX) internal func dimension(with attribute: NSLayoutConstraint.Attribute) -> Dimension { return Dimension(context, item, attribute) } internal func edge(with attribute: NSLayoutConstraint.Attribute) -> Edge { return Edge(context, item, attribute) } #endif internal func point(for attr1: Edge, _ attr2: Edge) -> Point { return Point(context, [attr1, attr2]) } internal func size(for attr1: Dimension, _ attr2: Dimension) -> Size { return Size(context, [attr1, attr2]) } internal func edges(for attr1: Edge, _ attr2: Edge, _ attr3: Edge, _ attr4: Edge) -> Edges { return Edges(context, [attr1, attr2, attr3, attr4]) } } public protocol SupportsTopLayoutProxy: LayoutProxy {} extension SupportsTopLayoutProxy { /// The top edge of the item. public var top: Edge { return edge(with: .top) } #if os(iOS) || os(tvOS) /// The top margin of the item. iOS exclusive. @available(iOS, introduced: 8.0) public var topMargin: Edge { return edge(with: .topMargin) } #endif } public protocol SupportsBottomLayoutProxy: LayoutProxy {} extension SupportsBottomLayoutProxy { /// The bottom edge of the item. public var bottom: Edge { return edge(with: .bottom) } #if os(iOS) || os(tvOS) /// The bottom margin of the item. iOS exclusive. @available(iOS, introduced: 8.0) public var bottomMargin: Edge { return edge(with: .bottomMargin) } #endif } public protocol SupportsRightLayoutProxy: LayoutProxy {} extension SupportsRightLayoutProxy { /// The right edge of the item. public var right: Edge { return edge(with: .right) } #if os(iOS) || os(tvOS) /// The right margin of the item. iOS exclusive. @available(iOS, introduced: 8.0) public var rightMargin: Edge { return edge(with: .rightMargin) } #endif } public protocol SupportsLeftLayoutProxy: LayoutProxy {} extension SupportsLeftLayoutProxy { /// The left edge of the item. public var left: Edge { return edge(with: .left) } #if os(iOS) || os(tvOS) /// The left margin of the item. iOS exclusive. @available(iOS, introduced: 8.0) public var leftMargin: Edge { return edge(with: .leftMargin) } #endif } public protocol SupportsLeadingLayoutProxy: LayoutProxy {} extension SupportsLeadingLayoutProxy { /// The leading edge of the item. public var leading: Edge { return edge(with: .leading) } #if os(iOS) || os(tvOS) /// The leading margin of the item. iOS exclusive. @available(iOS, introduced: 8.0) public var leadingMargin: Edge { return edge(with: .leadingMargin) } #endif } public protocol SupportsTrailingLayoutProxy: LayoutProxy {} extension SupportsTrailingLayoutProxy { /// The trailing edge of the item. public var trailing: Edge { return edge(with: .trailing) } #if os(iOS) || os(tvOS) /// The trailing margin of the item. iOS exclusive. @available(iOS, introduced: 8.0) public var trailingMargin: Edge { return edge(with: .trailingMargin) } #endif } public protocol SupportsEdgesLayoutProxy: SupportsTopLayoutProxy, SupportsBottomLayoutProxy, SupportsLeadingLayoutProxy, SupportsTrailingLayoutProxy, SupportsLeftLayoutProxy, SupportsRightLayoutProxy {} extension SupportsEdgesLayoutProxy { /// All edges of the item. This property affects `top`, `bottom`, `leading` /// and `trailing`. public var edges: Edges { return edges(for: top, leading, bottom, trailing) } #if os(iOS) || os(tvOS) /// All edges of the item with their respective margins. This property /// affects `topMargin`, `bottomMargin`, `leadingMargin` and /// `trailingMargin`. @available(iOS, introduced: 8.0) public var edgesWithinMargins: Edges { return edges(for: topMargin, leadingMargin, bottomMargin, trailingMargin) } #endif } public protocol SupportsCenterXLayoutProxy: LayoutProxy {} extension SupportsCenterXLayoutProxy { /// The horizontal center of the item. public var centerX: Edge { return edge(with: .centerX) } #if os(iOS) || os(tvOS) /// The horizontal center within the margins of the item. iOS exclusive. @available(iOS, introduced: 8.0) public var centerXWithinMargins: Edge { return edge(with: .centerXWithinMargins) } #endif } public protocol SupportsCenterYLayoutProxy: LayoutProxy {} extension SupportsCenterYLayoutProxy { /// The vertical center of the item. public var centerY: Edge { return edge(with: .centerY) } #if os(iOS) || os(tvOS) /// The vertical center within the margins of the item. iOS exclusive. @available(iOS, introduced: 8.0) public var centerYWithinMargins: Edge { return edge(with: .centerYWithinMargins) } #endif } public protocol SupportsCenteringLayoutProxy: SupportsCenterXLayoutProxy, SupportsCenterYLayoutProxy {} extension SupportsCenteringLayoutProxy { /// The center point of the item. This property affects `centerX` and /// `centerY`. public var center: Point { return point(for: centerX, centerY) } #if os(iOS) || os(tvOS) /// The center point within the margins of the item. This property affects /// `centerXWithinMargins` and `centerYWithinMargins`. iOS exclusive. @available(iOS, introduced: 8.0) public var centerWithinMargins: Point { return point(for: centerXWithinMargins, centerYWithinMargins) } #endif } public protocol SupportsWidthLayoutProxy: LayoutProxy {} extension SupportsWidthLayoutProxy { /// The width of the item. public var width: Dimension { return dimension(with: .width) } } public protocol SupportsHeightLayoutProxy: LayoutProxy {} extension SupportsHeightLayoutProxy { /// The height of the item. public var height: Dimension { return dimension(with: .height) } } public protocol SupportsSizeLayoutProxy: SupportsWidthLayoutProxy, SupportsHeightLayoutProxy {} extension SupportsSizeLayoutProxy { /// The size of the item. This property affects both `width` and `height`. public var size: Size { return size(for: width, height) } } public protocol SupportsBaselineLayoutProxy: LayoutProxy {} extension SupportsBaselineLayoutProxy { /// The last baseline of the item. public var lastBaseline: Edge { return edge(with: .lastBaseline) } /// The baseline of the item. public var baseline: Edge { return edge(with: .lastBaseline) } /// The first baseline of the item. iOS exclusive. @available(iOS, introduced: 8.0) @available(OSX, introduced: 10.11) public var firstBaseline: Edge { return edge(with: .firstBaseline) } } public protocol SupportsPositioningLayoutProxy: SupportsEdgesLayoutProxy, SupportsSizeLayoutProxy, SupportsCenteringLayoutProxy {} ================================================ FILE: Cartography/LayoutSupport.swift ================================================ // // LayoutSupport.swift // Cartography // // Created by Timothy Chilvers on 30/03/2016. // Copyright © 2016 Robert Böhnke. All rights reserved. // import Foundation #if os(iOS) || os(tvOS) import UIKit public final class LayoutSupport: LayoutItem { let layoutGuide : UILayoutSupport init(layoutGuide: UILayoutSupport) { self.layoutGuide = layoutGuide } public func asProxy(context: Context) -> LayoutSupportProxy { return LayoutSupportProxy(context: context, item: self) } } public extension UIViewController { var car_topLayoutGuide : LayoutSupport { get { return LayoutSupport(layoutGuide: self.topLayoutGuide) } } var car_bottomLayoutGuide : LayoutSupport { get { return LayoutSupport(layoutGuide: self.bottomLayoutGuide) } } } #endif ================================================ FILE: Cartography/LayoutSupportProxy.swift ================================================ // // LayoutSupportProxy.swift // Cartography-iOS // // Created by Vitor Travain on 11/10/17. // Copyright © 2017 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit public final class LayoutSupportProxy: SupportsHeightLayoutProxy, SupportsTopLayoutProxy, SupportsBottomLayoutProxy { public let context: Context private let layoutGuide: UILayoutSupport public var item: AnyObject { return layoutGuide } public init(context: Context, item: LayoutSupport) { self.context = context self.layoutGuide = item.layoutGuide } } #endif ================================================ FILE: Cartography/Point.swift ================================================ // // Point.swift // Cartography // // Created by Robert Böhnke on 18/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit #else import AppKit #endif public struct Point: Compound, RelativeCompoundEquality, RelativeCompoundInequality { public let context: Context public let properties: [Property] internal init(_ context: Context, _ properties: [Property]) { self.context = context self.properties = properties } } ================================================ FILE: Cartography/Priority.swift ================================================ // // Priority.swift // Cartography // // Created by Robert Böhnke on 18/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit public typealias LayoutPriority = UILayoutPriority #else import AppKit public typealias LayoutPriority = NSLayoutConstraint.Priority #endif precedencegroup CarthographyPriorityPrecedence { lowerThan: ComparisonPrecedence higherThan: AssignmentPrecedence } infix operator ~: CarthographyPriorityPrecedence /// Sets the priority for a constraint. /// /// - parameter lhs: The constraint to update. /// - parameter rhs: The new priority. /// /// - returns: The same constraint with its priority updated. /// @discardableResult public func ~ (lhs: NSLayoutConstraint, rhs: LayoutPriority) -> NSLayoutConstraint { lhs.priority = rhs return lhs } /// Sets the priority for a constraint. /// /// - parameter lhs: The constraint to update. /// - parameter rhs: The new priority. /// /// - returns: The same constraint with its priority updated. /// @discardableResult public func ~ (lhs: NSLayoutConstraint, rhs: Float) -> NSLayoutConstraint { lhs.priority = LayoutPriority(rawValue: rhs) return lhs } /// Sets the priority for multiple constraints. /// /// - parameter lhs: An array of `NSLayoutConstraint` instances. /// - parameter rhs: The new priority. /// /// - returns: The same constraints with their priorities updated. /// @discardableResult public func ~ (lhs: [NSLayoutConstraint], rhs: LayoutPriority) -> [NSLayoutConstraint] { return lhs.map { $0 ~ rhs } } /// Sets the priority for multiple constraints. /// /// - parameter lhs: An array of `NSLayoutConstraint` instances. /// - parameter rhs: The new priority. /// /// - returns: The same constraints with their priorities updated. /// @discardableResult public func ~ (lhs: [NSLayoutConstraint], rhs: Float) -> [NSLayoutConstraint] { return lhs.map { $0 ~ rhs } } ================================================ FILE: Cartography/Property.swift ================================================ // // Property.swift // Cartography // // Created by Robert Böhnke on 17/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit public typealias LayoutAttribute = NSLayoutConstraint.Attribute #else import AppKit public typealias LayoutAttribute = NSLayoutConstraint.Attribute #endif public protocol Property { var attribute: LayoutAttribute { get } var context: Context { get } var item: AnyObject { get } //type-erased Layoutitem } // MARK: Equality /// Properties conforming to this protocol can use the `==` operator with /// numerical constants. public protocol NumericalEquality : Property { } /// Declares a property equal to a numerical constant. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The numerical constant. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func == (lhs: NumericalEquality, rhs: CGFloat) -> NSLayoutConstraint { return lhs.context.addConstraint(lhs, coefficients: Coefficients(1, rhs)) } /// Properties conforming to this protocol can use the `==` operator with other /// properties of the same type. public protocol RelativeEquality : Property { } /// Declares a property equal to a the result of an expression. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The expression. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func == (lhs: P, rhs: Expression

) -> NSLayoutConstraint { return lhs.context.addConstraint(lhs, to: rhs.value, coefficients: rhs.coefficients[0]) } /// Declares a property equal to another property. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The other property. /// @discardableResult public func == (lhs: P, rhs: P) -> NSLayoutConstraint { return lhs.context.addConstraint(lhs, to: rhs) } // MARK: Inequality /// Properties conforming to this protocol can use the `<=` and `>=` operators /// with numerical constants. public protocol NumericalInequality : Property { } /// Declares a property less than or equal to a numerical constant. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The numerical constant. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func <= (lhs: NumericalInequality, rhs: CGFloat) -> NSLayoutConstraint { return lhs.context.addConstraint(lhs, coefficients: Coefficients(1, rhs), relation: .lessThanOrEqual) } /// Declares a property greater than or equal to a numerical constant. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The numerical constant. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func >= (lhs: NumericalInequality, rhs: CGFloat) -> NSLayoutConstraint { return lhs.context.addConstraint(lhs, coefficients: Coefficients(1, rhs), relation: .greaterThanOrEqual) } /// Properties conforming to this protocol can use the `<=` and `>=` operators /// with other properties of the same type. public protocol RelativeInequality : Property { } /// Declares a property less than or equal to another property. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The other property. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func <= (lhs: P, rhs: P) -> NSLayoutConstraint { return lhs.context.addConstraint(lhs, to: rhs, relation: .lessThanOrEqual) } /// Declares a property greater than or equal to another property. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The other property. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func >= (lhs: P, rhs: P) -> NSLayoutConstraint { return lhs.context.addConstraint(lhs, to: rhs, relation: .greaterThanOrEqual) } /// Declares a property less than or equal to the result of an expression. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The other property. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func <= (lhs: P, rhs: Expression

) -> NSLayoutConstraint { return lhs.context.addConstraint(lhs, to: rhs.value, coefficients: rhs.coefficients[0], relation: .lessThanOrEqual) } /// Declares a property greater than or equal to the result of an expression. /// /// - parameter lhs: The affected property. The associated item will have /// `translatesAutoresizingMaskIntoConstraints` set to `false`. /// - parameter rhs: The other property. /// /// - returns: An `NSLayoutConstraint`. /// @discardableResult public func >= (lhs: P, rhs: Expression

) -> NSLayoutConstraint { return lhs.context.addConstraint(lhs, to: rhs.value, coefficients: rhs.coefficients[0], relation: .greaterThanOrEqual) } // MARK: Addition public protocol Addition : Property { } public func + (c: CGFloat, rhs: P) -> Expression

{ return Expression(rhs, [ Coefficients(1, c) ]) } public func + (lhs: P, rhs: CGFloat) -> Expression

{ return rhs + lhs } public func + (c: CGFloat, rhs: Expression

) -> Expression

{ return Expression(rhs.value, rhs.coefficients.map { $0 + c }) } public func + (lhs: Expression

, rhs: CGFloat) -> Expression

{ return rhs + lhs } public func - (c: CGFloat, rhs: P) -> Expression

{ return Expression(rhs, [ Coefficients(1, -c) ]) } public func - (lhs: P, rhs: CGFloat) -> Expression

{ return rhs - lhs } public func - (c: CGFloat, rhs: Expression

) -> Expression

{ return Expression(rhs.value, rhs.coefficients.map { $0 - c}) } public func - (lhs: Expression

, rhs: CGFloat) -> Expression

{ return rhs - lhs } #if os(iOS) || os(tvOS) public func + (lhs: LayoutSupport, c : CGFloat) -> Expression { return Expression(lhs, [Coefficients(1, c)]) } public func - (lhs: LayoutSupport, c : CGFloat) -> Expression { return lhs + (-c) } #endif // MARK: Multiplication public protocol Multiplication : Property { } public func * (m: CGFloat, rhs: Expression

) -> Expression

{ return Expression(rhs.value, rhs.coefficients.map { $0 * m }) } public func * (lhs: Expression

, rhs: CGFloat) -> Expression

{ return rhs * lhs } public func * (m: CGFloat, rhs: P) -> Expression

{ return Expression(rhs, [ Coefficients(m, 0) ]) } public func * (lhs: P, rhs: CGFloat) -> Expression

{ return rhs * lhs } public func / (lhs: Expression

, rhs: CGFloat) -> Expression

{ return lhs * (1 / rhs) } public func / (lhs: P, rhs: CGFloat) -> Expression

{ return lhs * (1 / rhs) } ================================================ FILE: Cartography/Size.swift ================================================ // // Size.swift // Cartography // // Created by Robert Böhnke on 18/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // #if os(iOS) || os(tvOS) import UIKit #else import AppKit #endif public struct Size : Compound, RelativeCompoundEquality, RelativeCompoundInequality { public let context: Context public let properties: [Property] internal init(_ context: Context, _ properties: [Property]) { self.context = context self.properties = properties } } // MARK: Multiplication public func * (m: CGFloat, rhs: Expression) -> Expression { return Expression(rhs.value, rhs.coefficients.map { $0 * m }) } public func * (lhs: Expression, rhs: CGFloat) -> Expression { return rhs * lhs } public func * (m: CGFloat, rhs: Size) -> Expression { return Expression(rhs, [ Coefficients(m, 0), Coefficients(m, 0) ]) } public func * (lhs: Size, rhs: CGFloat) -> Expression { return rhs * lhs } // MARK: Division public func / (lhs: Expression, rhs: CGFloat) -> Expression { return lhs * (1 / rhs) } public func / (lhs: Size, rhs: CGFloat) -> Expression { return lhs * (1 / rhs) } ================================================ FILE: Cartography/View.swift ================================================ // // View.swift // Cartography // // Created by Robert Böhnke on 26/06/14. // Copyright (c) 2014 Robert Böhnke. All rights reserved. // import Foundation #if os(iOS) || os(tvOS) import UIKit public typealias View = UIView extension UIView: LayoutItem { public func asProxy(context: Context) -> ViewProxy { return ViewProxy(context: context, view: self) } } #else import AppKit public typealias View = NSView extension NSView: LayoutItem { public func asProxy(context: Context) -> ViewProxy { return ViewProxy(context: context, view: self) } } #endif ================================================ FILE: Cartography/ViewProxy.swift ================================================ // // ViewProxy.swift // Cartography-iOS // // Created by Vitor Travain on 10/10/17. // Copyright © 2017 Robert Böhnke. All rights reserved. // public final class ViewProxy: SupportsPositioningLayoutProxy, SupportsBaselineLayoutProxy, AutoresizingMaskLayoutProxy { public var context: Context private let view: View public var item: AnyObject { return self.view } public var translatesAutoresizingMaskIntoConstraints: Bool { get { return view.translatesAutoresizingMaskIntoConstraints } set(value) { view.translatesAutoresizingMaskIntoConstraints = value } } public init(context: Context, view: View) { self.context = context self.view = view } public var superview: ViewProxy? { return view.superview?.asProxy(context: context) } #if os(iOS) || os(tvOS) @available(iOS, introduced: 11.0) @available(tvOS, introduced: 11.0) public var safeAreaLayoutGuide: LayoutGuideProxy { return view.safeAreaLayoutGuide.asProxy(context: context) } @available(iOS, introduced: 9.0) @available(tvOS, introduced: 9.0) public var layoutMarginsGuide: LayoutGuideProxy { return view.layoutMarginsGuide.asProxy(context: context) } @available(iOS, introduced: 9.0) @available(tvOS, introduced: 9.0) public var readableContentGuide: LayoutGuideProxy { return view.readableContentGuide.asProxy(context: context) } #endif } @available(iOS, introduced: 9.0) @available(tvOS, introduced: 9.0) @available(iOS, deprecated: 11.0, message: "The safe area is available on iOS 11+ via 'safeAreaLayoutGuide'!") @available(tvOS, deprecated: 11.0, message: "The safe area is available on tvOS 11+ via 'safeAreaLayoutGuide'!") extension ViewProxy { #if os(iOS) || os(tvOS) public var safeArea: LayoutGuideProxy { if #available(iOS 11, *), #available(tvOS 11, *) { return safeAreaLayoutGuide } else { return layoutMarginsGuide } } #endif } ================================================ FILE: Cartography.podspec ================================================ Pod::Spec.new do |s| s.name = "Cartography" s.version = "4.0.0" s.summary = "Declarative Auto Layout in Swift" s.description = <<-DESC Set up your Auto Layout constraints declaratively and without any stringly typing! DESC s.homepage = "https://github.com/robb/Cartography" s.license = { :type => "MIT", :file => "LICENSE" } s.author = { "Robert Böhnke" => "robb@robb.is" } s.swift_version = "5.0" s.ios.deployment_target = "8.0" s.osx.deployment_target = "10.10" s.tvos.deployment_target = "9.0" s.source = { :git => "https://github.com/robb/Cartography.git", :tag => s.version } s.source_files = "Cartography/*.swift" end ================================================ FILE: Cartography.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 09F7751A581957EA262BC6A4 /* Pods_TestPods_Cartography_Mac_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 825625A8CCFA9B2B102BDDDB /* Pods_TestPods_Cartography_Mac_Tests.framework */; }; 1B319C622162740100DD91D4 /* ViewProxyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B319C612162740100DD91D4 /* ViewProxyTests.swift */; }; 40F7238205F9E56862357198 /* Pods_TestPods_Cartography_iOS_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C63D81EB2304A489BE29E6A /* Pods_TestPods_Cartography_iOS_Tests.framework */; }; 4A3756C91D67445F0036190E /* LayoutSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66AF7EED1CABEABC00249E27 /* LayoutSupport.swift */; }; 54143E4E1A93991D00208182 /* Distribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5467916E1A93962000DC9BF7 /* Distribute.swift */; }; 5435B8BF1AD8612C00B805F1 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5435B8B41AD8610300B805F1 /* Nimble.framework */; }; 5435B8C01AD8612C00B805F1 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5435B8B51AD8610300B805F1 /* Quick.framework */; }; 5435B8C11AD8613500B805F1 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5435B8B81AD8610300B805F1 /* Nimble.framework */; }; 5435B8C21AD8613500B805F1 /* Quick.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5435B8B91AD8610300B805F1 /* Quick.framework */; }; 543B37FA1AC82FBF00367D8B /* Edge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E901950A76C00B16707 /* Edge.swift */; }; 545F858D195322EA00791F75 /* Edges.swift in Sources */ = {isa = PBXBuildFile; fileRef = 545F858C195322EA00791F75 /* Edges.swift */; }; 545F858F1953235F00791F75 /* EdgesSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 545F858E1953235F00791F75 /* EdgesSpec.swift */; }; 5467916F1A93962000DC9BF7 /* Distribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5467916E1A93962000DC9BF7 /* Distribute.swift */; }; 546E9E891950A29300B16707 /* LayoutProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E881950A29300B16707 /* LayoutProxy.swift */; }; 546E9E8D1950A31100B16707 /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E8C1950A31100B16707 /* Dimension.swift */; }; 546E9E8F1950A33700B16707 /* Coefficients.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E8E1950A33700B16707 /* Coefficients.swift */; }; 546E9E911950A76C00B16707 /* Edge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E901950A76C00B16707 /* Edge.swift */; }; 546E9E951950A97F00B16707 /* Expression.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E941950A97F00B16707 /* Expression.swift */; }; 546E9EA21950B33D00B16707 /* DimensionSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54C96A23195063CD000CDD27 /* DimensionSpec.swift */; }; 547BC85519E2DD06007BEE9E /* Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = 547BC85419E2DD06007BEE9E /* Context.swift */; }; 547BC85719E2EB9B007BEE9E /* Constraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 547BC85619E2EB9B007BEE9E /* Constraint.swift */; }; 549B47B61A58198B002498C7 /* Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = 547BC85419E2DD06007BEE9E /* Context.swift */; }; 549B47B71A581992002498C7 /* Constraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 547BC85619E2EB9B007BEE9E /* Constraint.swift */; }; 54B093951A715E52008A1102 /* ConstraintGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B093941A715E52008A1102 /* ConstraintGroup.swift */; }; 54B093971A7165F2008A1102 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B093961A7165F2008A1102 /* Extensions.swift */; }; 54B093981A716A2A008A1102 /* ConstraintGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B093941A715E52008A1102 /* ConstraintGroup.swift */; }; 54B093991A716A2E008A1102 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B093961A7165F2008A1102 /* Extensions.swift */; }; 54BF29B01A9348B30066ED10 /* Align.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54BF29AF1A9348B30066ED10 /* Align.swift */; }; 54BF29B51A9350170066ED10 /* Align.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54BF29AF1A9348B30066ED10 /* Align.swift */; }; 54C96A17195063CD000CDD27 /* Cartography.h in Headers */ = {isa = PBXBuildFile; fileRef = 54C96A16195063CD000CDD27 /* Cartography.h */; settings = {ATTRIBUTES = (Public, ); }; }; 54C96A1D195063CD000CDD27 /* Cartography.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54C96A11195063CD000CDD27 /* Cartography.framework */; }; 54C96A30195064A6000CDD27 /* Property.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54C96A2F195064A6000CDD27 /* Property.swift */; }; 54DF9F3319DAD8DA00EE3609 /* Constrain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54DF9F3219DAD8DA00EE3609 /* Constrain.swift */; }; 54DF9F3419DAD8DD00EE3609 /* Constrain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54DF9F3219DAD8DA00EE3609 /* Constrain.swift */; }; 54F6A843195C20C200313D24 /* Cartography.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54F6A838195C20C100313D24 /* Cartography.framework */; }; 54F6A851195C213A00313D24 /* Cartography.h in Headers */ = {isa = PBXBuildFile; fileRef = 54C96A16195063CD000CDD27 /* Cartography.h */; settings = {ATTRIBUTES = (Public, ); }; }; 54F6A852195C213A00313D24 /* Coefficients.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E8E1950A33700B16707 /* Coefficients.swift */; }; 54F6A853195C213A00313D24 /* Compound.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A3F1951A41B0094B82A /* Compound.swift */; }; 54F6A854195C213A00313D24 /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E8C1950A31100B16707 /* Dimension.swift */; }; 54F6A856195C213A00313D24 /* Edges.swift in Sources */ = {isa = PBXBuildFile; fileRef = 545F858C195322EA00791F75 /* Edges.swift */; }; 54F6A857195C213A00313D24 /* Expression.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E941950A97F00B16707 /* Expression.swift */; }; 54F6A858195C213A00313D24 /* LayoutProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E881950A29300B16707 /* LayoutProxy.swift */; }; 54F6A859195C213A00313D24 /* Priority.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A351950FD320094B82A /* Priority.swift */; }; 54F6A85A195C213A00313D24 /* Point.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A3B1951A2B60094B82A /* Point.swift */; }; 54F6A85B195C213A00313D24 /* Property.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54C96A2F195064A6000CDD27 /* Property.swift */; }; 54F6A85C195C213A00313D24 /* Size.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A411951A8070094B82A /* Size.swift */; }; 54F6A864195C217800313D24 /* View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54F6A863195C217800313D24 /* View.swift */; }; 54F6A865195C226700313D24 /* View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54F6A863195C217800313D24 /* View.swift */; }; 54FA3A361950FD320094B82A /* Priority.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A351950FD320094B82A /* Priority.swift */; }; 54FA3A3C1951A2B60094B82A /* Point.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A3B1951A2B60094B82A /* Point.swift */; }; 54FA3A401951A41B0094B82A /* Compound.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A3F1951A41B0094B82A /* Compound.swift */; }; 54FA3A421951A8070094B82A /* Size.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A411951A8070094B82A /* Size.swift */; }; 632F09271BF1E7FC002431A3 /* Cartography.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 632F090A1BF1E7AA002431A3 /* Cartography.framework */; }; 632F09341BF1F0DD002431A3 /* Cartography.h in Headers */ = {isa = PBXBuildFile; fileRef = 54C96A16195063CD000CDD27 /* Cartography.h */; settings = {ATTRIBUTES = (Public, ); }; }; 632F09351BF1F127002431A3 /* Align.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54BF29AF1A9348B30066ED10 /* Align.swift */; }; 632F09361BF1F127002431A3 /* Coefficients.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E8E1950A33700B16707 /* Coefficients.swift */; }; 632F09371BF1F127002431A3 /* Compound.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A3F1951A41B0094B82A /* Compound.swift */; }; 632F09381BF1F127002431A3 /* Constrain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54DF9F3219DAD8DA00EE3609 /* Constrain.swift */; }; 632F09391BF1F127002431A3 /* Constraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 547BC85619E2EB9B007BEE9E /* Constraint.swift */; }; 632F093A1BF1F127002431A3 /* ConstraintGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B093941A715E52008A1102 /* ConstraintGroup.swift */; }; 632F093B1BF1F127002431A3 /* Context.swift in Sources */ = {isa = PBXBuildFile; fileRef = 547BC85419E2DD06007BEE9E /* Context.swift */; }; 632F093C1BF1F127002431A3 /* Dimension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E8C1950A31100B16707 /* Dimension.swift */; }; 632F093D1BF1F127002431A3 /* Distribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5467916E1A93962000DC9BF7 /* Distribute.swift */; }; 632F093E1BF1F127002431A3 /* Edge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E901950A76C00B16707 /* Edge.swift */; }; 632F093F1BF1F127002431A3 /* Edges.swift in Sources */ = {isa = PBXBuildFile; fileRef = 545F858C195322EA00791F75 /* Edges.swift */; }; 632F09401BF1F127002431A3 /* Expression.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E941950A97F00B16707 /* Expression.swift */; }; 632F09411BF1F127002431A3 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54B093961A7165F2008A1102 /* Extensions.swift */; }; 632F09421BF1F127002431A3 /* LayoutProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 546E9E881950A29300B16707 /* LayoutProxy.swift */; }; 632F09431BF1F127002431A3 /* Point.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A3B1951A2B60094B82A /* Point.swift */; }; 632F09441BF1F127002431A3 /* Priority.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A351950FD320094B82A /* Priority.swift */; }; 632F09451BF1F127002431A3 /* Property.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54C96A2F195064A6000CDD27 /* Property.swift */; }; 632F09461BF1F127002431A3 /* Size.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54FA3A411951A8070094B82A /* Size.swift */; }; 632F09471BF1F127002431A3 /* View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54F6A863195C217800313D24 /* View.swift */; }; 632F094B1BF1F146002431A3 /* DimensionSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54C96A23195063CD000CDD27 /* DimensionSpec.swift */; }; 632F094E1BF1F146002431A3 /* EdgesSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 545F858E1953235F00791F75 /* EdgesSpec.swift */; }; 66AF7EEE1CABEABC00249E27 /* LayoutSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66AF7EED1CABEABC00249E27 /* LayoutSupport.swift */; }; 9722953C1F950A1E00FA4AF9 /* ViewProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97E7F0A81F8D598A004857CE /* ViewProxy.swift */; }; 9722953D1F950A1F00FA4AF9 /* ViewProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97E7F0A81F8D598A004857CE /* ViewProxy.swift */; }; 9722953E1F950A2E00FA4AF9 /* LayoutSupportProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C8F1F8E73F200C57CE1 /* LayoutSupportProxy.swift */; }; 9722953F1F950A3000FA4AF9 /* LayoutSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66AF7EED1CABEABC00249E27 /* LayoutSupport.swift */; }; 977C36821F9FAC890057A057 /* AutoresizingMaskLayoutProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 977C36811F9FAC890057A057 /* AutoresizingMaskLayoutProxy.swift */; }; 977C36831F9FC2900057A057 /* AutoresizingMaskLayoutProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 977C36811F9FAC890057A057 /* AutoresizingMaskLayoutProxy.swift */; }; 977C36841F9FC2910057A057 /* AutoresizingMaskLayoutProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 977C36811F9FAC890057A057 /* AutoresizingMaskLayoutProxy.swift */; }; 97885B1E1FC4F7C800BB4E51 /* LayoutGuideSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 979F29C91F94DC6B00257363 /* LayoutGuideSpec.swift */; }; 979558E41F9700B40096BBEA /* LayoutGuideSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 979F29C91F94DC6B00257363 /* LayoutGuideSpec.swift */; }; 979558EC1F97015E0096BBEA /* TestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9E1F8E774700C57CE1 /* TestView.swift */; }; 979558ED1F97015E0096BBEA /* TestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9E1F8E774700C57CE1 /* TestView.swift */; }; 979558EE1F97015F0096BBEA /* TestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9E1F8E774700C57CE1 /* TestView.swift */; }; 979558EF1F9701660096BBEA /* EdgeSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9A1F8E774700C57CE1 /* EdgeSpec.swift */; }; 979558F01F9701670096BBEA /* EdgeSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9A1F8E774700C57CE1 /* EdgeSpec.swift */; }; 979558F11F9701670096BBEA /* EdgeSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9A1F8E774700C57CE1 /* EdgeSpec.swift */; }; 979558F21F97016C0096BBEA /* EdgesSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 545F858E1953235F00791F75 /* EdgesSpec.swift */; }; 979558F31F9701730096BBEA /* AlignSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9B1F8E774700C57CE1 /* AlignSpec.swift */; }; 979558F41F9701740096BBEA /* AlignSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9B1F8E774700C57CE1 /* AlignSpec.swift */; }; 979558F51F9701750096BBEA /* AlignSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9B1F8E774700C57CE1 /* AlignSpec.swift */; }; 979558F61F97017D0096BBEA /* LayoutSupportSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9C1F8E774700C57CE1 /* LayoutSupportSpec.swift */; }; 979558F71F97017F0096BBEA /* LayoutSupportSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9C1F8E774700C57CE1 /* LayoutSupportSpec.swift */; }; 979558F81F9701850096BBEA /* PrioritySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9D1F8E774700C57CE1 /* PrioritySpec.swift */; }; 979558F91F9701860096BBEA /* PrioritySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9D1F8E774700C57CE1 /* PrioritySpec.swift */; }; 979558FA1F9701870096BBEA /* PrioritySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9D1F8E774700C57CE1 /* PrioritySpec.swift */; }; 979558FB1F97018C0096BBEA /* DimensionSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54C96A23195063CD000CDD27 /* DimensionSpec.swift */; }; 979558FC1F97019E0096BBEA /* Matchers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9F1F8E774700C57CE1 /* Matchers.swift */; }; 979558FD1F9701A10096BBEA /* Matchers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9F1F8E774700C57CE1 /* Matchers.swift */; }; 979558FE1F9701A70096BBEA /* Matchers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C9F1F8E774700C57CE1 /* Matchers.swift */; }; 979558FF1F9701AC0096BBEA /* DistributeSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA01F8E774700C57CE1 /* DistributeSpec.swift */; }; 979559001F9701AD0096BBEA /* DistributeSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA01F8E774700C57CE1 /* DistributeSpec.swift */; }; 979559011F9701AE0096BBEA /* DistributeSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA01F8E774700C57CE1 /* DistributeSpec.swift */; }; 979559021F9701B10096BBEA /* PointSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA11F8E774700C57CE1 /* PointSpec.swift */; }; 979559031F9701B20096BBEA /* PointSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA11F8E774700C57CE1 /* PointSpec.swift */; }; 979559041F9701B30096BBEA /* PointSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA11F8E774700C57CE1 /* PointSpec.swift */; }; 979559051F9701BB0096BBEA /* ViewHierarchySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA31F8E774700C57CE1 /* ViewHierarchySpec.swift */; }; 979559061F9701BC0096BBEA /* ViewHierarchySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA31F8E774700C57CE1 /* ViewHierarchySpec.swift */; }; 979559071F9701BD0096BBEA /* ViewHierarchySpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA31F8E774700C57CE1 /* ViewHierarchySpec.swift */; }; 979559081F9701C90096BBEA /* MemoryLeakSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA51F8E774700C57CE1 /* MemoryLeakSpec.swift */; }; 979559091F9701C90096BBEA /* MemoryLeakSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA51F8E774700C57CE1 /* MemoryLeakSpec.swift */; }; 9795590A1F9701CA0096BBEA /* MemoryLeakSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA51F8E774700C57CE1 /* MemoryLeakSpec.swift */; }; 9795590B1F9701CD0096BBEA /* ConstraintGroupSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA61F8E774700C57CE1 /* ConstraintGroupSpec.swift */; }; 9795590C1F9701CE0096BBEA /* ConstraintGroupSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA61F8E774700C57CE1 /* ConstraintGroupSpec.swift */; }; 9795590D1F9701CF0096BBEA /* ConstraintGroupSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA61F8E774700C57CE1 /* ConstraintGroupSpec.swift */; }; 9795590E1F9701D20096BBEA /* SizeSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA81F8E774700C57CE1 /* SizeSpec.swift */; }; 9795590F1F9701D30096BBEA /* SizeSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA81F8E774700C57CE1 /* SizeSpec.swift */; }; 979559101F9701D40096BBEA /* SizeSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA81F8E774700C57CE1 /* SizeSpec.swift */; }; 979F29CB1F94DCA800257363 /* LayoutGuideSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 979F29C91F94DC6B00257363 /* LayoutGuideSpec.swift */; }; 97D17C901F8E73F200C57CE1 /* LayoutSupportProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C8F1F8E73F200C57CE1 /* LayoutSupportProxy.swift */; }; 97D17C921F8E740B00C57CE1 /* LayoutSupportProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C8F1F8E73F200C57CE1 /* LayoutSupportProxy.swift */; }; 97D17C961F8E774400C57CE1 /* LayoutGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C951F8E774400C57CE1 /* LayoutGuide.swift */; }; 97D17C971F8E774400C57CE1 /* LayoutGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C951F8E774400C57CE1 /* LayoutGuide.swift */; }; 97D17C981F8E774400C57CE1 /* LayoutGuide.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17C951F8E774400C57CE1 /* LayoutGuide.swift */; }; 97D17CAA1F8E779300C57CE1 /* LayoutGuideProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA91F8E779300C57CE1 /* LayoutGuideProxy.swift */; }; 97D17CAB1F8E779300C57CE1 /* LayoutGuideProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA91F8E779300C57CE1 /* LayoutGuideProxy.swift */; }; 97D17CAC1F8E779300C57CE1 /* LayoutGuideProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D17CA91F8E779300C57CE1 /* LayoutGuideProxy.swift */; }; 97E7F0A91F8D598A004857CE /* ViewProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97E7F0A81F8D598A004857CE /* ViewProxy.swift */; }; 97F50E521F962CF300C6DCF5 /* LayoutProxy+TypeErasure.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F50E511F962CF300C6DCF5 /* LayoutProxy+TypeErasure.swift */; }; 97F50E541F9633AA00C6DCF5 /* ViewLayoutGuideSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F50E531F9633AA00C6DCF5 /* ViewLayoutGuideSpec.swift */; }; 97F50E551F9633AA00C6DCF5 /* ViewLayoutGuideSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F50E531F9633AA00C6DCF5 /* ViewLayoutGuideSpec.swift */; }; 97F50E561F96401200C6DCF5 /* LayoutProxy+TypeErasure.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F50E511F962CF300C6DCF5 /* LayoutProxy+TypeErasure.swift */; }; 97F50E571F96401300C6DCF5 /* LayoutProxy+TypeErasure.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F50E511F962CF300C6DCF5 /* LayoutProxy+TypeErasure.swift */; }; A75B6143FF12C54FF3223B47 /* Pods_TestPods_Cartography_tvOS_tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0827A83361EACF1E6062607E /* Pods_TestPods_Cartography_tvOS_tests.framework */; }; D63BD7B82089B6FA00061239 /* LayoutItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE85314F1F9363DC003EC021 /* LayoutItem.swift */; }; EE8531501F936462003EC021 /* LayoutItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE85314F1F9363DC003EC021 /* LayoutItem.swift */; }; EE8531531F94131B003EC021 /* LayoutItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE85314F1F9363DC003EC021 /* LayoutItem.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 54C96A1E195063CD000CDD27 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 54C96A08195063CD000CDD27 /* Project object */; proxyType = 1; remoteGlobalIDString = 54C96A10195063CD000CDD27; remoteInfo = Cartography; }; 54C96A33195067C1000CDD27 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 54C96A08195063CD000CDD27 /* Project object */; proxyType = 1; remoteGlobalIDString = 54C96A10195063CD000CDD27; remoteInfo = Cartography; }; 54F6A844195C20C200313D24 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 54C96A08195063CD000CDD27 /* Project object */; proxyType = 1; remoteGlobalIDString = 54F6A837195C20C100313D24; remoteInfo = "Cartography-Mac"; }; 632F09281BF1E7FC002431A3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 54C96A08195063CD000CDD27 /* Project object */; proxyType = 1; remoteGlobalIDString = 632F09091BF1E7AA002431A3; remoteInfo = "Cartography-tvOS"; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 5435B8C41AD8614F00B805F1 /* Copy Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; 5435B8C71AD8616000B805F1 /* Copy Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 007A7C5A4CF651CD9D550547 /* Pods-TestPods-Cartography-iOS-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestPods-Cartography-iOS-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestPods-Cartography-iOS-Tests/Pods-TestPods-Cartography-iOS-Tests.debug.xcconfig"; sourceTree = ""; }; 0827A83361EACF1E6062607E /* Pods_TestPods_Cartography_tvOS_tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestPods_Cartography_tvOS_tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0C63D81EB2304A489BE29E6A /* Pods_TestPods_Cartography_iOS_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestPods_Cartography_iOS_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 125531F897589C40A2E6968E /* Pods-TestPods-Cartography-iOS-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestPods-Cartography-iOS-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestPods-Cartography-iOS-Tests/Pods-TestPods-Cartography-iOS-Tests.release.xcconfig"; sourceTree = ""; }; 1B319C612162740100DD91D4 /* ViewProxyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewProxyTests.swift; sourceTree = ""; }; 3C61A3F684FD20F5E1B1F8D1 /* Pods-TestPods-Cartography-Mac-Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestPods-Cartography-Mac-Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestPods-Cartography-Mac-Tests/Pods-TestPods-Cartography-Mac-Tests.debug.xcconfig"; sourceTree = ""; }; 45CEEFB5D80398843533851A /* Pods-TestPods-Cartography-tvOS-tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestPods-Cartography-tvOS-tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TestPods-Cartography-tvOS-tests/Pods-TestPods-Cartography-tvOS-tests.debug.xcconfig"; sourceTree = ""; }; 5435B8B41AD8610300B805F1 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Nimble.framework; sourceTree = ""; }; 5435B8B51AD8610300B805F1 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Quick.framework; sourceTree = ""; }; 5435B8B81AD8610300B805F1 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Nimble.framework; sourceTree = ""; }; 5435B8B91AD8610300B805F1 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Quick.framework; sourceTree = ""; }; 545F858C195322EA00791F75 /* Edges.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Edges.swift; sourceTree = ""; }; 545F858E1953235F00791F75 /* EdgesSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = EdgesSpec.swift; sourceTree = ""; }; 5467916E1A93962000DC9BF7 /* Distribute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Distribute.swift; sourceTree = ""; }; 546E9E881950A29300B16707 /* LayoutProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayoutProxy.swift; sourceTree = ""; }; 546E9E8C1950A31100B16707 /* Dimension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Dimension.swift; sourceTree = ""; }; 546E9E8E1950A33700B16707 /* Coefficients.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Coefficients.swift; sourceTree = ""; }; 546E9E901950A76C00B16707 /* Edge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Edge.swift; sourceTree = ""; }; 546E9E941950A97F00B16707 /* Expression.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Expression.swift; sourceTree = ""; }; 547BC85419E2DD06007BEE9E /* Context.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Context.swift; sourceTree = ""; }; 547BC85619E2EB9B007BEE9E /* Constraint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constraint.swift; sourceTree = ""; }; 54B093941A715E52008A1102 /* ConstraintGroup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintGroup.swift; sourceTree = ""; }; 54B093961A7165F2008A1102 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 54BF29AF1A9348B30066ED10 /* Align.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Align.swift; sourceTree = ""; }; 54C96A11195063CD000CDD27 /* Cartography.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cartography.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 54C96A15195063CD000CDD27 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54C96A16195063CD000CDD27 /* Cartography.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Cartography.h; sourceTree = ""; }; 54C96A1C195063CD000CDD27 /* Cartography-iOS-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Cartography-iOS-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 54C96A23195063CD000CDD27 /* DimensionSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = DimensionSpec.swift; sourceTree = ""; }; 54C96A2F195064A6000CDD27 /* Property.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Property.swift; sourceTree = ""; }; 54DF9F3219DAD8DA00EE3609 /* Constrain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constrain.swift; sourceTree = ""; }; 54F6A838195C20C100313D24 /* Cartography.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cartography.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 54F6A842195C20C200313D24 /* Cartography-Mac-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Cartography-Mac-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 54F6A863195C217800313D24 /* View.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = View.swift; sourceTree = ""; }; 54FA3A351950FD320094B82A /* Priority.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Priority.swift; sourceTree = ""; }; 54FA3A3B1951A2B60094B82A /* Point.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Point.swift; sourceTree = ""; }; 54FA3A3F1951A41B0094B82A /* Compound.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Compound.swift; sourceTree = ""; }; 54FA3A411951A8070094B82A /* Size.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Size.swift; sourceTree = ""; }; 632F090A1BF1E7AA002431A3 /* Cartography.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cartography.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 632F09221BF1E7FC002431A3 /* Cartography-tvOS-tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Cartography-tvOS-tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 646D273E5E982865688DF028 /* Pods_Cartography_tvOS_tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Cartography_tvOS_tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 66AF7EED1CABEABC00249E27 /* LayoutSupport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LayoutSupport.swift; sourceTree = ""; }; 690415756227F5789FBF9D77 /* Pods-TestPods-Cartography-Mac-Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestPods-Cartography-Mac-Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestPods-Cartography-Mac-Tests/Pods-TestPods-Cartography-Mac-Tests.release.xcconfig"; sourceTree = ""; }; 7BBFE24E2FED786C571966AE /* Pods_Cartography_Mac_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Cartography_Mac_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7D3596ED3F137EB677E57692 /* Pods-TestPods-Cartography-tvOS-tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestPods-Cartography-tvOS-tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-TestPods-Cartography-tvOS-tests/Pods-TestPods-Cartography-tvOS-tests.release.xcconfig"; sourceTree = ""; }; 825625A8CCFA9B2B102BDDDB /* Pods_TestPods_Cartography_Mac_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestPods_Cartography_Mac_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 977C36811F9FAC890057A057 /* AutoresizingMaskLayoutProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoresizingMaskLayoutProxy.swift; sourceTree = ""; }; 979F29C91F94DC6B00257363 /* LayoutGuideSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutGuideSpec.swift; sourceTree = ""; }; 97D17C8F1F8E73F200C57CE1 /* LayoutSupportProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutSupportProxy.swift; sourceTree = ""; }; 97D17C951F8E774400C57CE1 /* LayoutGuide.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutGuide.swift; sourceTree = ""; }; 97D17C9A1F8E774700C57CE1 /* EdgeSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EdgeSpec.swift; sourceTree = ""; }; 97D17C9B1F8E774700C57CE1 /* AlignSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlignSpec.swift; sourceTree = ""; }; 97D17C9C1F8E774700C57CE1 /* LayoutSupportSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutSupportSpec.swift; sourceTree = ""; }; 97D17C9D1F8E774700C57CE1 /* PrioritySpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrioritySpec.swift; sourceTree = ""; }; 97D17C9E1F8E774700C57CE1 /* TestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestView.swift; sourceTree = ""; }; 97D17C9F1F8E774700C57CE1 /* Matchers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Matchers.swift; sourceTree = ""; }; 97D17CA01F8E774700C57CE1 /* DistributeSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DistributeSpec.swift; sourceTree = ""; }; 97D17CA11F8E774700C57CE1 /* PointSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointSpec.swift; sourceTree = ""; }; 97D17CA31F8E774700C57CE1 /* ViewHierarchySpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewHierarchySpec.swift; sourceTree = ""; }; 97D17CA41F8E774700C57CE1 /* DimensionSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DimensionSpec.swift; sourceTree = ""; }; 97D17CA51F8E774700C57CE1 /* MemoryLeakSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoryLeakSpec.swift; sourceTree = ""; }; 97D17CA61F8E774700C57CE1 /* ConstraintGroupSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConstraintGroupSpec.swift; sourceTree = ""; }; 97D17CA81F8E774700C57CE1 /* SizeSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SizeSpec.swift; sourceTree = ""; }; 97D17CA91F8E779300C57CE1 /* LayoutGuideProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutGuideProxy.swift; sourceTree = ""; }; 97E7F0A81F8D598A004857CE /* ViewProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewProxy.swift; sourceTree = ""; }; 97F50E511F962CF300C6DCF5 /* LayoutProxy+TypeErasure.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LayoutProxy+TypeErasure.swift"; sourceTree = ""; }; 97F50E531F9633AA00C6DCF5 /* ViewLayoutGuideSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewLayoutGuideSpec.swift; sourceTree = ""; }; EE85314F1F9363DC003EC021 /* LayoutItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutItem.swift; sourceTree = ""; }; EEDD4098FF7503B1F9188F10 /* Pods_Cartography_iOS_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Cartography_iOS_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 54C96A0D195063CD000CDD27 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 54C96A19195063CD000CDD27 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 54C96A1D195063CD000CDD27 /* Cartography.framework in Frameworks */, 5435B8BF1AD8612C00B805F1 /* Nimble.framework in Frameworks */, 5435B8C01AD8612C00B805F1 /* Quick.framework in Frameworks */, 40F7238205F9E56862357198 /* Pods_TestPods_Cartography_iOS_Tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 54F6A834195C20C100313D24 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 54F6A83F195C20C200313D24 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 54F6A843195C20C200313D24 /* Cartography.framework in Frameworks */, 5435B8C11AD8613500B805F1 /* Nimble.framework in Frameworks */, 5435B8C21AD8613500B805F1 /* Quick.framework in Frameworks */, 09F7751A581957EA262BC6A4 /* Pods_TestPods_Cartography_Mac_Tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 632F09061BF1E7AA002431A3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 632F091F1BF1E7FC002431A3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 632F09271BF1E7FC002431A3 /* Cartography.framework in Frameworks */, A75B6143FF12C54FF3223B47 /* Pods_TestPods_Cartography_tvOS_tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 2F12B8E5120CB9E4A9CE0B7F /* Pods */ = { isa = PBXGroup; children = ( 690415756227F5789FBF9D77 /* Pods-TestPods-Cartography-Mac-Tests.release.xcconfig */, 007A7C5A4CF651CD9D550547 /* Pods-TestPods-Cartography-iOS-Tests.debug.xcconfig */, 125531F897589C40A2E6968E /* Pods-TestPods-Cartography-iOS-Tests.release.xcconfig */, 45CEEFB5D80398843533851A /* Pods-TestPods-Cartography-tvOS-tests.debug.xcconfig */, 7D3596ED3F137EB677E57692 /* Pods-TestPods-Cartography-tvOS-tests.release.xcconfig */, 3C61A3F684FD20F5E1B1F8D1 /* Pods-TestPods-Cartography-Mac-Tests.debug.xcconfig */, ); name = Pods; sourceTree = ""; }; 5435B8B21AD8610300B805F1 /* iOS */ = { isa = PBXGroup; children = ( 5435B8B41AD8610300B805F1 /* Nimble.framework */, 5435B8B51AD8610300B805F1 /* Quick.framework */, ); name = iOS; path = Carthage/Build/iOS; sourceTree = ""; }; 5435B8B61AD8610300B805F1 /* Mac */ = { isa = PBXGroup; children = ( 5435B8B81AD8610300B805F1 /* Nimble.framework */, 5435B8B91AD8610300B805F1 /* Quick.framework */, ); name = Mac; path = Carthage/Build/Mac; sourceTree = ""; }; 5435B8BA1AD8610700B805F1 /* Frameworks */ = { isa = PBXGroup; children = ( 632F09041BF1E771002431A3 /* tvOS */, 5435B8B21AD8610300B805F1 /* iOS */, 5435B8B61AD8610300B805F1 /* Mac */, 7BBFE24E2FED786C571966AE /* Pods_Cartography_Mac_Tests.framework */, EEDD4098FF7503B1F9188F10 /* Pods_Cartography_iOS_Tests.framework */, 646D273E5E982865688DF028 /* Pods_Cartography_tvOS_tests.framework */, 825625A8CCFA9B2B102BDDDB /* Pods_TestPods_Cartography_Mac_Tests.framework */, 0C63D81EB2304A489BE29E6A /* Pods_TestPods_Cartography_iOS_Tests.framework */, 0827A83361EACF1E6062607E /* Pods_TestPods_Cartography_tvOS_tests.framework */, ); name = Frameworks; sourceTree = ""; }; 54C96A07195063CD000CDD27 = { isa = PBXGroup; children = ( 54C96A13195063CD000CDD27 /* Cartography */, 5435B8BA1AD8610700B805F1 /* Frameworks */, 54C96A12195063CD000CDD27 /* Products */, 2F12B8E5120CB9E4A9CE0B7F /* Pods */, ); sourceTree = ""; }; 54C96A12195063CD000CDD27 /* Products */ = { isa = PBXGroup; children = ( 54C96A11195063CD000CDD27 /* Cartography.framework */, 54C96A1C195063CD000CDD27 /* Cartography-iOS-Tests.xctest */, 54F6A838195C20C100313D24 /* Cartography.framework */, 54F6A842195C20C200313D24 /* Cartography-Mac-Tests.xctest */, 632F090A1BF1E7AA002431A3 /* Cartography.framework */, 632F09221BF1E7FC002431A3 /* Cartography-tvOS-tests.xctest */, ); name = Products; sourceTree = ""; }; 54C96A13195063CD000CDD27 /* Cartography */ = { isa = PBXGroup; children = ( 54C96A16195063CD000CDD27 /* Cartography.h */, 54BF29AF1A9348B30066ED10 /* Align.swift */, 546E9E8E1950A33700B16707 /* Coefficients.swift */, 54FA3A3F1951A41B0094B82A /* Compound.swift */, 54DF9F3219DAD8DA00EE3609 /* Constrain.swift */, 547BC85619E2EB9B007BEE9E /* Constraint.swift */, 54B093941A715E52008A1102 /* ConstraintGroup.swift */, 547BC85419E2DD06007BEE9E /* Context.swift */, 546E9E8C1950A31100B16707 /* Dimension.swift */, 5467916E1A93962000DC9BF7 /* Distribute.swift */, 546E9E901950A76C00B16707 /* Edge.swift */, 545F858C195322EA00791F75 /* Edges.swift */, 546E9E941950A97F00B16707 /* Expression.swift */, 54B093961A7165F2008A1102 /* Extensions.swift */, EE85314F1F9363DC003EC021 /* LayoutItem.swift */, 546E9E881950A29300B16707 /* LayoutProxy.swift */, 97F50E511F962CF300C6DCF5 /* LayoutProxy+TypeErasure.swift */, 977C36811F9FAC890057A057 /* AutoresizingMaskLayoutProxy.swift */, 54FA3A3B1951A2B60094B82A /* Point.swift */, 54FA3A351950FD320094B82A /* Priority.swift */, 54C96A2F195064A6000CDD27 /* Property.swift */, 54FA3A411951A8070094B82A /* Size.swift */, 54F6A863195C217800313D24 /* View.swift */, 97E7F0A81F8D598A004857CE /* ViewProxy.swift */, 66AF7EED1CABEABC00249E27 /* LayoutSupport.swift */, 97D17C8F1F8E73F200C57CE1 /* LayoutSupportProxy.swift */, 97D17C951F8E774400C57CE1 /* LayoutGuide.swift */, 97D17CA91F8E779300C57CE1 /* LayoutGuideProxy.swift */, 97D17C991F8E774700C57CE1 /* CartographyTests */, 54C96A14195063CD000CDD27 /* Supporting Files */, ); path = Cartography; sourceTree = ""; }; 54C96A14195063CD000CDD27 /* Supporting Files */ = { isa = PBXGroup; children = ( 54C96A15195063CD000CDD27 /* Info.plist */, ); name = "Supporting Files"; sourceTree = ""; }; 632F09041BF1E771002431A3 /* tvOS */ = { isa = PBXGroup; children = ( ); name = tvOS; sourceTree = ""; }; 97D17C991F8E774700C57CE1 /* CartographyTests */ = { isa = PBXGroup; children = ( 97D17C9A1F8E774700C57CE1 /* EdgeSpec.swift */, 545F858E1953235F00791F75 /* EdgesSpec.swift */, 97D17C9B1F8E774700C57CE1 /* AlignSpec.swift */, 97D17C9C1F8E774700C57CE1 /* LayoutSupportSpec.swift */, 979F29C91F94DC6B00257363 /* LayoutGuideSpec.swift */, 97D17C9D1F8E774700C57CE1 /* PrioritySpec.swift */, 54C96A23195063CD000CDD27 /* DimensionSpec.swift */, 97D17C9E1F8E774700C57CE1 /* TestView.swift */, 97D17C9F1F8E774700C57CE1 /* Matchers.swift */, 97D17CA01F8E774700C57CE1 /* DistributeSpec.swift */, 97D17CA11F8E774700C57CE1 /* PointSpec.swift */, 97D17CA31F8E774700C57CE1 /* ViewHierarchySpec.swift */, 97D17CA41F8E774700C57CE1 /* DimensionSpec.swift */, 97D17CA51F8E774700C57CE1 /* MemoryLeakSpec.swift */, 97D17CA61F8E774700C57CE1 /* ConstraintGroupSpec.swift */, 97D17CA81F8E774700C57CE1 /* SizeSpec.swift */, 97F50E531F9633AA00C6DCF5 /* ViewLayoutGuideSpec.swift */, 1B319C612162740100DD91D4 /* ViewProxyTests.swift */, ); path = CartographyTests; sourceTree = SOURCE_ROOT; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 54C96A0E195063CD000CDD27 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 54C96A17195063CD000CDD27 /* Cartography.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; 54F6A835195C20C100313D24 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 54F6A851195C213A00313D24 /* Cartography.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; 632F09071BF1E7AA002431A3 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 632F09341BF1F0DD002431A3 /* Cartography.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 54C96A10195063CD000CDD27 /* Cartography-iOS */ = { isa = PBXNativeTarget; buildConfigurationList = 54C96A27195063CD000CDD27 /* Build configuration list for PBXNativeTarget "Cartography-iOS" */; buildPhases = ( 54C96A0E195063CD000CDD27 /* Headers */, 54C96A0C195063CD000CDD27 /* Sources */, 54C96A0D195063CD000CDD27 /* Frameworks */, 54C96A0F195063CD000CDD27 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "Cartography-iOS"; productName = Cartography; productReference = 54C96A11195063CD000CDD27 /* Cartography.framework */; productType = "com.apple.product-type.framework"; }; 54C96A1B195063CD000CDD27 /* Cartography-iOS-Tests */ = { isa = PBXNativeTarget; buildConfigurationList = 54C96A2A195063CD000CDD27 /* Build configuration list for PBXNativeTarget "Cartography-iOS-Tests" */; buildPhases = ( 24028C048E277759E25AE786 /* [CP] Check Pods Manifest.lock */, 54C96A18195063CD000CDD27 /* Sources */, 54C96A19195063CD000CDD27 /* Frameworks */, 54C96A1A195063CD000CDD27 /* Resources */, 5435B8C71AD8616000B805F1 /* Copy Frameworks */, B6F7D337FFD9973F4083FCD3 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( 54C96A1F195063CD000CDD27 /* PBXTargetDependency */, 54C96A34195067C1000CDD27 /* PBXTargetDependency */, ); name = "Cartography-iOS-Tests"; productName = CartographyTests; productReference = 54C96A1C195063CD000CDD27 /* Cartography-iOS-Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; 54F6A837195C20C100313D24 /* Cartography-Mac */ = { isa = PBXNativeTarget; buildConfigurationList = 54F6A84B195C20C200313D24 /* Build configuration list for PBXNativeTarget "Cartography-Mac" */; buildPhases = ( 54F6A835195C20C100313D24 /* Headers */, 54F6A833195C20C100313D24 /* Sources */, 54F6A834195C20C100313D24 /* Frameworks */, 54F6A836195C20C100313D24 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "Cartography-Mac"; productName = "Cartography-Mac"; productReference = 54F6A838195C20C100313D24 /* Cartography.framework */; productType = "com.apple.product-type.framework"; }; 54F6A841195C20C200313D24 /* Cartography-Mac-Tests */ = { isa = PBXNativeTarget; buildConfigurationList = 54F6A84E195C20C200313D24 /* Build configuration list for PBXNativeTarget "Cartography-Mac-Tests" */; buildPhases = ( DA4D07B720B9F2E815A2DE6C /* [CP] Check Pods Manifest.lock */, 54F6A83E195C20C200313D24 /* Sources */, 54F6A83F195C20C200313D24 /* Frameworks */, 54F6A840195C20C200313D24 /* Resources */, 5435B8C41AD8614F00B805F1 /* Copy Frameworks */, 28E8257CE249F34272E74DA2 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( 54F6A845195C20C200313D24 /* PBXTargetDependency */, ); name = "Cartography-Mac-Tests"; productName = "Cartography-MacTests"; productReference = 54F6A842195C20C200313D24 /* Cartography-Mac-Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; 632F09091BF1E7AA002431A3 /* Cartography-tvOS */ = { isa = PBXNativeTarget; buildConfigurationList = 632F090F1BF1E7AA002431A3 /* Build configuration list for PBXNativeTarget "Cartography-tvOS" */; buildPhases = ( 632F09071BF1E7AA002431A3 /* Headers */, 632F09051BF1E7AA002431A3 /* Sources */, 632F09061BF1E7AA002431A3 /* Frameworks */, 632F09081BF1E7AA002431A3 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = "Cartography-tvOS"; productName = "Cartography-tvOS"; productReference = 632F090A1BF1E7AA002431A3 /* Cartography.framework */; productType = "com.apple.product-type.framework"; }; 632F09211BF1E7FC002431A3 /* Cartography-tvOS-tests */ = { isa = PBXNativeTarget; buildConfigurationList = 632F092A1BF1E7FC002431A3 /* Build configuration list for PBXNativeTarget "Cartography-tvOS-tests" */; buildPhases = ( 23F8E3613FE66A444A4C94A1 /* [CP] Check Pods Manifest.lock */, 632F091E1BF1E7FC002431A3 /* Sources */, 632F091F1BF1E7FC002431A3 /* Frameworks */, 632F09201BF1E7FC002431A3 /* Resources */, 02D0EEC2C95F444E52A8D1D4 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( 632F09291BF1E7FC002431A3 /* PBXTargetDependency */, ); name = "Cartography-tvOS-tests"; productName = "Cartography-tvOS-tests"; productReference = 632F09221BF1E7FC002431A3 /* Cartography-tvOS-tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 54C96A08195063CD000CDD27 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Robert Böhnke"; TargetAttributes = { 54C96A10195063CD000CDD27 = { CreatedOnToolsVersion = 6.0; LastSwiftMigration = 0900; }; 54C96A1B195063CD000CDD27 = { CreatedOnToolsVersion = 6.0; LastSwiftMigration = 0900; TestTargetID = 54C96A10195063CD000CDD27; }; 54F6A837195C20C100313D24 = { CreatedOnToolsVersion = 6.0; LastSwiftMigration = 0900; }; 54F6A841195C20C200313D24 = { CreatedOnToolsVersion = 6.0; LastSwiftMigration = 0900; TestTargetID = 54F6A837195C20C100313D24; }; 632F09091BF1E7AA002431A3 = { CreatedOnToolsVersion = 7.1; LastSwiftMigration = 0900; }; 632F09211BF1E7FC002431A3 = { CreatedOnToolsVersion = 7.1; LastSwiftMigration = 0900; }; }; }; buildConfigurationList = 54C96A0B195063CD000CDD27 /* Build configuration list for PBXProject "Cartography" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 54C96A07195063CD000CDD27; productRefGroup = 54C96A12195063CD000CDD27 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 54C96A10195063CD000CDD27 /* Cartography-iOS */, 54C96A1B195063CD000CDD27 /* Cartography-iOS-Tests */, 54F6A837195C20C100313D24 /* Cartography-Mac */, 54F6A841195C20C200313D24 /* Cartography-Mac-Tests */, 632F09091BF1E7AA002431A3 /* Cartography-tvOS */, 632F09211BF1E7FC002431A3 /* Cartography-tvOS-tests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 54C96A0F195063CD000CDD27 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 54C96A1A195063CD000CDD27 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 54F6A836195C20C100313D24 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 54F6A840195C20C200313D24 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 632F09081BF1E7AA002431A3 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 632F09201BF1E7FC002431A3 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 02D0EEC2C95F444E52A8D1D4 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-TestPods-Cartography-tvOS-tests/Pods-TestPods-Cartography-tvOS-tests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Nimble-tvOS/Nimble.framework", "${BUILT_PRODUCTS_DIR}/Quick-tvOS/Quick.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestPods-Cartography-tvOS-tests/Pods-TestPods-Cartography-tvOS-tests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 23F8E3613FE66A444A4C94A1 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-TestPods-Cartography-tvOS-tests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 24028C048E277759E25AE786 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-TestPods-Cartography-iOS-Tests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 28E8257CE249F34272E74DA2 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-TestPods-Cartography-Mac-Tests/Pods-TestPods-Cartography-Mac-Tests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Nimble-macOS/Nimble.framework", "${BUILT_PRODUCTS_DIR}/Quick-macOS/Quick.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestPods-Cartography-Mac-Tests/Pods-TestPods-Cartography-Mac-Tests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; B6F7D337FFD9973F4083FCD3 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-TestPods-Cartography-iOS-Tests/Pods-TestPods-Cartography-iOS-Tests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Nimble-iOS/Nimble.framework", "${BUILT_PRODUCTS_DIR}/Quick-iOS/Quick.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestPods-Cartography-iOS-Tests/Pods-TestPods-Cartography-iOS-Tests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; DA4D07B720B9F2E815A2DE6C /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-TestPods-Cartography-Mac-Tests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 54C96A0C195063CD000CDD27 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 54C96A30195064A6000CDD27 /* Property.swift in Sources */, 54B093971A7165F2008A1102 /* Extensions.swift in Sources */, 546E9E891950A29300B16707 /* LayoutProxy.swift in Sources */, 54FA3A361950FD320094B82A /* Priority.swift in Sources */, 97D17C961F8E774400C57CE1 /* LayoutGuide.swift in Sources */, 547BC85719E2EB9B007BEE9E /* Constraint.swift in Sources */, 547BC85519E2DD06007BEE9E /* Context.swift in Sources */, 97F50E521F962CF300C6DCF5 /* LayoutProxy+TypeErasure.swift in Sources */, EE8531501F936462003EC021 /* LayoutItem.swift in Sources */, 977C36821F9FAC890057A057 /* AutoresizingMaskLayoutProxy.swift in Sources */, 545F858D195322EA00791F75 /* Edges.swift in Sources */, 97E7F0A91F8D598A004857CE /* ViewProxy.swift in Sources */, 546E9E8D1950A31100B16707 /* Dimension.swift in Sources */, 54DF9F3319DAD8DA00EE3609 /* Constrain.swift in Sources */, 5467916F1A93962000DC9BF7 /* Distribute.swift in Sources */, 546E9E911950A76C00B16707 /* Edge.swift in Sources */, 54FA3A421951A8070094B82A /* Size.swift in Sources */, 54FA3A3C1951A2B60094B82A /* Point.swift in Sources */, 97D17C901F8E73F200C57CE1 /* LayoutSupportProxy.swift in Sources */, 54F6A864195C217800313D24 /* View.swift in Sources */, 546E9E8F1950A33700B16707 /* Coefficients.swift in Sources */, 54FA3A401951A41B0094B82A /* Compound.swift in Sources */, 54B093951A715E52008A1102 /* ConstraintGroup.swift in Sources */, 66AF7EEE1CABEABC00249E27 /* LayoutSupport.swift in Sources */, 54BF29B01A9348B30066ED10 /* Align.swift in Sources */, 546E9E951950A97F00B16707 /* Expression.swift in Sources */, 97D17CAA1F8E779300C57CE1 /* LayoutGuideProxy.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 54C96A18195063CD000CDD27 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 979558F61F97017D0096BBEA /* LayoutSupportSpec.swift in Sources */, 97F50E541F9633AA00C6DCF5 /* ViewLayoutGuideSpec.swift in Sources */, 1B319C622162740100DD91D4 /* ViewProxyTests.swift in Sources */, 9795590B1F9701CD0096BBEA /* ConstraintGroupSpec.swift in Sources */, 979559081F9701C90096BBEA /* MemoryLeakSpec.swift in Sources */, 979558FC1F97019E0096BBEA /* Matchers.swift in Sources */, 979559021F9701B10096BBEA /* PointSpec.swift in Sources */, 979558F81F9701850096BBEA /* PrioritySpec.swift in Sources */, 979558EC1F97015E0096BBEA /* TestView.swift in Sources */, 979558F31F9701730096BBEA /* AlignSpec.swift in Sources */, 979559051F9701BB0096BBEA /* ViewHierarchySpec.swift in Sources */, 979558FF1F9701AC0096BBEA /* DistributeSpec.swift in Sources */, 545F858F1953235F00791F75 /* EdgesSpec.swift in Sources */, 546E9EA21950B33D00B16707 /* DimensionSpec.swift in Sources */, 979F29CB1F94DCA800257363 /* LayoutGuideSpec.swift in Sources */, 979558EF1F9701660096BBEA /* EdgeSpec.swift in Sources */, 9795590E1F9701D20096BBEA /* SizeSpec.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 54F6A833195C20C100313D24 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 54F6A85C195C213A00313D24 /* Size.swift in Sources */, 9722953F1F950A3000FA4AF9 /* LayoutSupport.swift in Sources */, 54F6A85B195C213A00313D24 /* Property.swift in Sources */, 549B47B71A581992002498C7 /* Constraint.swift in Sources */, 54F6A856195C213A00313D24 /* Edges.swift in Sources */, 54F6A858195C213A00313D24 /* LayoutProxy.swift in Sources */, 54BF29B51A9350170066ED10 /* Align.swift in Sources */, 97F50E561F96401200C6DCF5 /* LayoutProxy+TypeErasure.swift in Sources */, 9722953C1F950A1E00FA4AF9 /* ViewProxy.swift in Sources */, 977C36831F9FC2900057A057 /* AutoresizingMaskLayoutProxy.swift in Sources */, 97D17CAB1F8E779300C57CE1 /* LayoutGuideProxy.swift in Sources */, 543B37FA1AC82FBF00367D8B /* Edge.swift in Sources */, EE8531531F94131B003EC021 /* LayoutItem.swift in Sources */, 54F6A853195C213A00313D24 /* Compound.swift in Sources */, 54B093991A716A2E008A1102 /* Extensions.swift in Sources */, 97D17C971F8E774400C57CE1 /* LayoutGuide.swift in Sources */, 54F6A859195C213A00313D24 /* Priority.swift in Sources */, 54F6A852195C213A00313D24 /* Coefficients.swift in Sources */, 54143E4E1A93991D00208182 /* Distribute.swift in Sources */, 9722953E1F950A2E00FA4AF9 /* LayoutSupportProxy.swift in Sources */, 54F6A85A195C213A00313D24 /* Point.swift in Sources */, 54B093981A716A2A008A1102 /* ConstraintGroup.swift in Sources */, 54F6A865195C226700313D24 /* View.swift in Sources */, 54DF9F3419DAD8DD00EE3609 /* Constrain.swift in Sources */, 549B47B61A58198B002498C7 /* Context.swift in Sources */, 54F6A854195C213A00313D24 /* Dimension.swift in Sources */, 54F6A857195C213A00313D24 /* Expression.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 54F6A83E195C20C200313D24 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 979558FE1F9701A70096BBEA /* Matchers.swift in Sources */, 979559001F9701AD0096BBEA /* DistributeSpec.swift in Sources */, 9795590F1F9701D30096BBEA /* SizeSpec.swift in Sources */, 979558F41F9701740096BBEA /* AlignSpec.swift in Sources */, 979559031F9701B20096BBEA /* PointSpec.swift in Sources */, 979558FB1F97018C0096BBEA /* DimensionSpec.swift in Sources */, 9795590C1F9701CE0096BBEA /* ConstraintGroupSpec.swift in Sources */, 979559061F9701BC0096BBEA /* ViewHierarchySpec.swift in Sources */, 979558F91F9701860096BBEA /* PrioritySpec.swift in Sources */, 97885B1E1FC4F7C800BB4E51 /* LayoutGuideSpec.swift in Sources */, 979558F21F97016C0096BBEA /* EdgesSpec.swift in Sources */, 979558ED1F97015E0096BBEA /* TestView.swift in Sources */, 979559091F9701C90096BBEA /* MemoryLeakSpec.swift in Sources */, 979558F01F9701670096BBEA /* EdgeSpec.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 632F09051BF1E7AA002431A3 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 977C36841F9FC2910057A057 /* AutoresizingMaskLayoutProxy.swift in Sources */, 632F09351BF1F127002431A3 /* Align.swift in Sources */, 9722953D1F950A1F00FA4AF9 /* ViewProxy.swift in Sources */, 632F09361BF1F127002431A3 /* Coefficients.swift in Sources */, 632F09371BF1F127002431A3 /* Compound.swift in Sources */, 632F09381BF1F127002431A3 /* Constrain.swift in Sources */, 632F09391BF1F127002431A3 /* Constraint.swift in Sources */, 632F093A1BF1F127002431A3 /* ConstraintGroup.swift in Sources */, 97D17C921F8E740B00C57CE1 /* LayoutSupportProxy.swift in Sources */, 97F50E571F96401300C6DCF5 /* LayoutProxy+TypeErasure.swift in Sources */, 97D17C981F8E774400C57CE1 /* LayoutGuide.swift in Sources */, 632F093B1BF1F127002431A3 /* Context.swift in Sources */, 97D17CAC1F8E779300C57CE1 /* LayoutGuideProxy.swift in Sources */, D63BD7B82089B6FA00061239 /* LayoutItem.swift in Sources */, 632F093C1BF1F127002431A3 /* Dimension.swift in Sources */, 632F093D1BF1F127002431A3 /* Distribute.swift in Sources */, 632F093E1BF1F127002431A3 /* Edge.swift in Sources */, 632F093F1BF1F127002431A3 /* Edges.swift in Sources */, 632F09401BF1F127002431A3 /* Expression.swift in Sources */, 632F09411BF1F127002431A3 /* Extensions.swift in Sources */, 632F09421BF1F127002431A3 /* LayoutProxy.swift in Sources */, 632F09431BF1F127002431A3 /* Point.swift in Sources */, 632F09441BF1F127002431A3 /* Priority.swift in Sources */, 632F09451BF1F127002431A3 /* Property.swift in Sources */, 632F09461BF1F127002431A3 /* Size.swift in Sources */, 4A3756C91D67445F0036190E /* LayoutSupport.swift in Sources */, 632F09471BF1F127002431A3 /* View.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 632F091E1BF1E7FC002431A3 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 979558F71F97017F0096BBEA /* LayoutSupportSpec.swift in Sources */, 97F50E551F9633AA00C6DCF5 /* ViewLayoutGuideSpec.swift in Sources */, 9795590D1F9701CF0096BBEA /* ConstraintGroupSpec.swift in Sources */, 9795590A1F9701CA0096BBEA /* MemoryLeakSpec.swift in Sources */, 979558FD1F9701A10096BBEA /* Matchers.swift in Sources */, 979559041F9701B30096BBEA /* PointSpec.swift in Sources */, 979558FA1F9701870096BBEA /* PrioritySpec.swift in Sources */, 979558EE1F97015F0096BBEA /* TestView.swift in Sources */, 979558F51F9701750096BBEA /* AlignSpec.swift in Sources */, 979559071F9701BD0096BBEA /* ViewHierarchySpec.swift in Sources */, 979559011F9701AE0096BBEA /* DistributeSpec.swift in Sources */, 632F094B1BF1F146002431A3 /* DimensionSpec.swift in Sources */, 979558E41F9700B40096BBEA /* LayoutGuideSpec.swift in Sources */, 632F094E1BF1F146002431A3 /* EdgesSpec.swift in Sources */, 979558F11F9701670096BBEA /* EdgeSpec.swift in Sources */, 979559101F9701D40096BBEA /* SizeSpec.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 54C96A1F195063CD000CDD27 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 54C96A10195063CD000CDD27 /* Cartography-iOS */; targetProxy = 54C96A1E195063CD000CDD27 /* PBXContainerItemProxy */; }; 54C96A34195067C1000CDD27 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 54C96A10195063CD000CDD27 /* Cartography-iOS */; targetProxy = 54C96A33195067C1000CDD27 /* PBXContainerItemProxy */; }; 54F6A845195C20C200313D24 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 54F6A837195C20C100313D24 /* Cartography-Mac */; targetProxy = 54F6A844195C20C200313D24 /* PBXContainerItemProxy */; }; 632F09291BF1E7FC002431A3 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 632F09091BF1E7AA002431A3 /* Cartography-tvOS */; targetProxy = 632F09281BF1E7FC002431A3 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ 54C96A25195063CD000CDD27 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; METAL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; 54C96A26195063CD000CDD27 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; METAL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; 54C96A28195063CD000CDD27 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Cartography/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Cartography; SKIP_INSTALL = YES; }; name = Debug; }; 54C96A29195063CD000CDD27 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Cartography/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Cartography; SKIP_INSTALL = YES; }; name = Release; }; 54C96A2B195063CD000CDD27 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 007A7C5A4CF651CD9D550547 /* Pods-TestPods-Cartography-iOS-Tests.debug.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = CartographyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; METAL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; }; 54C96A2C195063CD000CDD27 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 125531F897589C40A2E6968E /* Pods-TestPods-Cartography-iOS-Tests.release.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = CartographyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; METAL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; }; 54F6A84C195C20C200313D24 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Cartography/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; METAL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Cartography; SDKROOT = macosx; SKIP_INSTALL = YES; SUPPORTS_MACCATALYST = YES; }; name = Debug; }; 54F6A84D195C20C200313D24 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; INFOPLIST_FILE = Cartography/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; METAL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = Cartography; SDKROOT = macosx; SKIP_INSTALL = YES; SUPPORTS_MACCATALYST = YES; }; name = Release; }; 54F6A84F195C20C200313D24 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 3C61A3F684FD20F5E1B1F8D1 /* Pods-TestPods-Cartography-Mac-Tests.debug.xcconfig */; buildSettings = { COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/Mac", ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = CartographyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; METAL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; name = Debug; }; 54F6A850195C20C200313D24 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 690415756227F5789FBF9D77 /* Pods-TestPods-Cartography-Mac-Tests.release.xcconfig */; buildSettings = { COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/Mac", ); INFOPLIST_FILE = CartographyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.10; METAL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; name = Release; }; 632F09101BF1E7AA002431A3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_IDENTITY = ""; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "$(SRCROOT)/Cartography/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = com.robertboehnke.Cartography; PRODUCT_NAME = Cartography; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; }; 632F09111BF1E7AA002431A3 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "$(SRCROOT)/Cartography/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = com.robertboehnke.Cartography; PRODUCT_NAME = Cartography; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; }; 632F092B1BF1E7FC002431A3 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 45CEEFB5D80398843533851A /* Pods-TestPods-Cartography-tvOS-tests.debug.xcconfig */; buildSettings = { DEBUG_INFORMATION_FORMAT = dwarf; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = CartographyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.Cartography.Cartography-tvOS-tests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; }; 632F092C1BF1E7FC002431A3 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7D3596ED3F137EB677E57692 /* Pods-TestPods-Cartography-tvOS-tests.release.xcconfig */; buildSettings = { COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = CartographyTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.robertboehnke.Cartography.Cartography-tvOS-tests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 54C96A0B195063CD000CDD27 /* Build configuration list for PBXProject "Cartography" */ = { isa = XCConfigurationList; buildConfigurations = ( 54C96A25195063CD000CDD27 /* Debug */, 54C96A26195063CD000CDD27 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 54C96A27195063CD000CDD27 /* Build configuration list for PBXNativeTarget "Cartography-iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( 54C96A28195063CD000CDD27 /* Debug */, 54C96A29195063CD000CDD27 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 54C96A2A195063CD000CDD27 /* Build configuration list for PBXNativeTarget "Cartography-iOS-Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( 54C96A2B195063CD000CDD27 /* Debug */, 54C96A2C195063CD000CDD27 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 54F6A84B195C20C200313D24 /* Build configuration list for PBXNativeTarget "Cartography-Mac" */ = { isa = XCConfigurationList; buildConfigurations = ( 54F6A84C195C20C200313D24 /* Debug */, 54F6A84D195C20C200313D24 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 54F6A84E195C20C200313D24 /* Build configuration list for PBXNativeTarget "Cartography-Mac-Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( 54F6A84F195C20C200313D24 /* Debug */, 54F6A850195C20C200313D24 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 632F090F1BF1E7AA002431A3 /* Build configuration list for PBXNativeTarget "Cartography-tvOS" */ = { isa = XCConfigurationList; buildConfigurations = ( 632F09101BF1E7AA002431A3 /* Debug */, 632F09111BF1E7AA002431A3 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 632F092A1BF1E7FC002431A3 /* Build configuration list for PBXNativeTarget "Cartography-tvOS-tests" */ = { isa = XCConfigurationList; buildConfigurations = ( 632F092B1BF1E7FC002431A3 /* Debug */, 632F092C1BF1E7FC002431A3 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 54C96A08195063CD000CDD27 /* Project object */; } ================================================ FILE: Cartography.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: Cartography.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: Cartography.xcodeproj/xcshareddata/xcschemes/Cartography-Mac.xcscheme ================================================ ================================================ FILE: Cartography.xcodeproj/xcshareddata/xcschemes/Cartography-iOS.xcscheme ================================================ ================================================ FILE: Cartography.xcodeproj/xcshareddata/xcschemes/Cartography-tvOS.xcscheme ================================================ ================================================ FILE: Cartography.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: Cartography.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: CartographyTests/AlignSpec.swift ================================================ import Cartography import Nimble import Quick class AlignSpec: QuickSpec { override func spec() { var window: TestWindow! var viewA: TestView! var viewB: TestView! var viewC: TestView! beforeEach { window = TestWindow(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) viewA = TestView(frame: CGRect.zero) window.addSubview(viewA) viewB = TestView(frame: CGRect.zero) window.addSubview(viewB) viewC = TestView(frame: CGRect.zero) window.addSubview(viewC) constrain(viewA) { view in view.height == 200 view.width == 200 view.top == view.superview!.top + 10 view.left == view.superview!.left + 10 } } describe("for edges") { beforeEach { constrain(viewA, viewB, viewC) { viewA, viewB, viewC in align(top: viewA, viewB, viewC) align(right: viewA, viewB, viewC) align(bottom: viewA, viewB, viewC) align(left: viewA, viewB, viewC) } } it("should align edges") { expect(viewA.frame).to(equal(viewB.frame)) expect(viewA.frame).to(equal(viewB.frame)) } it("should disable translating autoresizing masks into constraints") { expect(viewA).notTo(translateAutoresizingMasksToConstraints()) expect(viewB).notTo(translateAutoresizingMasksToConstraints()) expect(viewC).notTo(translateAutoresizingMasksToConstraints()) } } describe("for horizontal and vertical centers") { beforeEach { constrain(viewA, viewB, viewC) { viewA, viewB, viewC in viewA.size == viewB.size viewB.size == viewC.size align(centerX: viewA, viewB, viewC) align(centerY: viewA, viewB, viewC) } } it("should align center points") { expect(viewA.frame).to(equal(viewB.frame)) expect(viewA.frame).to(equal(viewB.frame)) } it("should disable translating autoresizing masks into constraints") { expect(viewA).notTo(translateAutoresizingMasksToConstraints()) expect(viewB).notTo(translateAutoresizingMasksToConstraints()) expect(viewC).notTo(translateAutoresizingMasksToConstraints()) } } describe("no constraints") { it("should have no constraints for a single view alignment") { constrain(viewA) { viewA in let constraints = align(top: [viewA]) expect(constraints.count).to(equal(0)) } } it("should have no constraints for no view") { let constraints = align(top: []) expect(constraints.count).to(equal(0)) } } } } ================================================ FILE: CartographyTests/ConstraintGroupSpec.swift ================================================ import Cartography import Nimble import Quick class ConstraintGroupSpec: QuickSpec { override func spec() { var window: TestWindow! var view1: TestView! beforeEach { window = TestWindow(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) view1 = TestView(frame: CGRect.zero) window.addSubview(view1) } describe("Activating a group") { var a: ConstraintGroup! var b: ConstraintGroup! beforeEach { a = constrain(view1) { view in view.width == 100 view.height == 100 } a.active = false b = constrain(view1) { view in view.width == 200 view.height == 200 } b.active = false } it("should update the view") { a.active = true view1.layoutIfNeeded() expect(view1.frame.width).to(equal(100)) expect(view1.frame.height).to(equal(100)) a.active = false b.active = true window.layoutIfNeeded() expect(view1.frame.width).to(equal(200)) expect(view1.frame.height).to(equal(200)) } } describe("Replacing constraints") { var view2: TestView! beforeEach { view2 = TestView(frame: CGRect.zero) window.addSubview(view2) constrain(view1, view2) { view1, view2 in view1.top == view1.superview!.top + 10 view1.left == view1.superview!.left + 10 view1.right == view1.superview!.right - 10 view1.height == 200 view2.centerX == view1.centerX view2.top == view1.bottom view2.width == view1.width } window.layoutIfNeeded() } it("should update the view") { let group = constrain(view2) { view2 in view2.height == 100 } window.layoutIfNeeded() expect(view2.frame.height).to(equal(100)) constrain(view2, replace: group) { view2 in view2.bottom >= view2.superview!.bottom } window.layoutIfNeeded() expect(view2.frame.height).to(equal(190)) } } } } ================================================ FILE: CartographyTests/DimensionSpec.swift ================================================ import Cartography import Nimble import Quick class DimensionSpec: QuickSpec { override func spec() { var window: TestWindow! var view: TestView! beforeEach { window = TestWindow(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) view = TestView(frame: CGRect.zero) window.addSubview(view) } describe("LayoutProxy.width") { it("should support relative equalities") { constrain(view) { view in view.width == view.superview!.width } window.layoutIfNeeded() expect(view.frame.width).to(equal(400)) } it("should support relative inequalities") { constrain(view) { view in view.width <= view.superview!.width view.width >= view.superview!.width } window.layoutIfNeeded() expect(view.frame.width).to(equal(400)) } it("should support addition") { constrain(view) { view in view.width == view.superview!.width + 100 } window.layoutIfNeeded() expect(view.frame.width).to(equal(500)) } it("should support subtraction") { constrain(view) { view in view.width == view.superview!.width - 100 } window.layoutIfNeeded() expect(view.frame.width).to(equal(300)) } it("should support multiplication") { constrain(view) { view in view.width == view.superview!.width * 2 } window.layoutIfNeeded() expect(view.frame.width).to(equal(800)) } it("should support division") { constrain(view) { view in view.width == view.superview!.width / 2 } window.layoutIfNeeded() expect(view.frame.width).to(equal(200)) } it("should support complex expressions") { constrain(view) { view in view.width == view.superview!.width / 2 + 100 } window.layoutIfNeeded() expect(view.frame.width).to(equal(300)) } it("should support numerical equalities") { constrain(view) { view in view.width == 200 } window.layoutIfNeeded() expect(view.frame.width).to(equal(200)) } } describe("LayoutProxy.height") { it("should support relative equalities") { constrain(view) { view in view.height == view.superview!.height } window.layoutIfNeeded() expect(view.frame.height).to(equal(400)) } it("should support relative inequalities") { constrain(view) { view in view.height <= view.superview!.height view.height >= view.superview!.height } window.layoutIfNeeded() expect(view.frame.height).to(equal(400)) } it("should support addition") { constrain(view) { view in view.height == view.superview!.height + 100 } window.layoutIfNeeded() expect(view.frame.height).to(equal(500)) } it("should support subtraction") { constrain(view) { view in view.height == view.superview!.height - 100 } window.layoutIfNeeded() expect(view.frame.height).to(equal(300)) } it("should support multiplication") { constrain(view) { view in view.height == view.superview!.height * 2 } window.layoutIfNeeded() expect(view.frame.height).to(equal(800)) } it("should support division") { constrain(view) { view in view.height == view.superview!.height / 2 } window.layoutIfNeeded() expect(view.frame.height).to(equal(200)) } it("should support complex expressions") { constrain(view) { view in view.height == view.superview!.height / 2 + 100 } window.layoutIfNeeded() expect(view.frame.height).to(equal(300)) } it("should support numerical equalities") { constrain(view) { view in view.height == 200 } window.layoutIfNeeded() expect(view.frame.height).to(equal(200)) } } } } ================================================ FILE: CartographyTests/DistributeSpec.swift ================================================ import Cartography import Nimble import Quick class DistributeSpec: QuickSpec { override func spec() { var window: TestWindow! var viewA: TestView! var viewB: TestView! var viewC: TestView! let constraintsGroup = ConstraintGroup() beforeEach { window = TestWindow(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) viewA = TestView(frame: CGRect.zero) window.addSubview(viewA) viewB = TestView(frame: CGRect.zero) window.addSubview(viewB) viewC = TestView(frame: CGRect.zero) window.addSubview(viewC) constrain(viewA, viewB, viewC, replace: constraintsGroup) { viewA, viewB, viewC in viewA.width == 100 viewA.height == 100 viewA.top == viewA.superview!.top viewA.left == viewA.superview!.left viewA.size == viewB.size viewA.size == viewC.size } } describe("from left to right") { beforeEach { constrain(viewA, viewB, viewC) { viewA, viewB, viewC in align(centerY: viewA, viewB, viewC) distribute(by: 10, leftToRight: viewA, viewB, viewC) } window.layoutIfNeeded() } it("should distribute the views") { expect(viewA.frame.minX).to(equal( 0)) expect(viewB.frame.minX).to(equal(110)) expect(viewC.frame.minX).to(equal(220)) } it("should disable translating autoresizing masks into constraints") { expect(viewA).notTo(translateAutoresizingMasksToConstraints()) expect(viewB).notTo(translateAutoresizingMasksToConstraints()) expect(viewC).notTo(translateAutoresizingMasksToConstraints()) } } describe("vertically") { beforeEach { constrain(viewA, viewB, viewC) { viewA, viewB, viewC in align(centerX: viewA, viewB, viewC) distribute(by: 10, vertically: viewA, viewB, viewC) } window.layoutIfNeeded() } it("should distribute the views") { expect(viewA.frame.minY).to(equal( 0)) expect(viewB.frame.minY).to(equal(110)) expect(viewC.frame.minY).to(equal(220)) } it("should disable translating autoresizing masks into constraints") { expect(viewA).notTo(translateAutoresizingMasksToConstraints()) expect(viewB).notTo(translateAutoresizingMasksToConstraints()) expect(viewC).notTo(translateAutoresizingMasksToConstraints()) } } describe("no constraints") { it("should have no constraints for a single view distribution") { constrain(viewA) { viewA in let constraints = distribute(horizontally: [viewA]) expect(constraints.count).to(equal(0)) } } it("should have no constraints for no view") { let constraints = distribute(horizontally: []) expect(constraints.count).to(equal(0)) } } describe("When distributing width") { beforeEach { constrain(viewA, viewB, viewC, replace: constraintsGroup) { viewA, viewB, viewC in viewA.width == 50 distribute(equalWidth: [viewA, viewB, viewC]) } window.layoutIfNeeded() } it("should distribute the same width through all the views") { expect(viewA.frame.width).to(equal(50)) expect(viewB.frame.width).to(equal(viewA.frame.width)) expect(viewC.frame.width).to(equal(viewB.frame.width)) } } describe("When distributing height") { beforeEach { constrain(viewA, viewB, viewC, replace: constraintsGroup) { viewA, viewB, viewC in viewA.height == 50 distribute(equalHeight: [viewA, viewB, viewC]) } window.layoutIfNeeded() } it("should distribute the same height through all the views") { expect(viewA.frame.height).to(equal(50)) expect(viewB.frame.height).to(equal(viewA.frame.height)) expect(viewC.frame.height).to(equal(viewB.frame.height)) } } } } ================================================ FILE: CartographyTests/EdgeSpec.swift ================================================ import Cartography import Nimble import Quick class EdgeSpec: QuickSpec { override func spec() { var window: TestWindow! var view: TestView! beforeEach { window = TestWindow(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) view = TestView(frame: CGRect.zero) window.addSubview(view) constrain(view) { view in view.height == 200 view.width == 200 } } describe("LayoutProxy.top") { it("should support relative equalities") { constrain(view) { view in view.top == view.superview!.top } window.layoutIfNeeded() expect(view.frame.minY).to(equal(0)) } it("should support relative inequalities") { constrain(view) { view in view.top <= view.superview!.top view.top >= view.superview!.top } window.layoutIfNeeded() expect(view.frame.minY).to(equal(0)) } it("should support addition") { constrain(view) { view in view.top == view.superview!.top + 100 } window.layoutIfNeeded() expect(view.frame.minY).to(equal(100)) } it("should support subtraction") { constrain(view) { view in view.top == view.superview!.top - 100 } window.layoutIfNeeded() expect(view.frame.minY).to(equal(-100)) } } describe("LayoutProxy.right") { it("should support relative equalities") { constrain(view) { view in view.right == view.superview!.right } window.layoutIfNeeded() expect(view.frame.maxX).to(equal(400)) } it("should support relative inequalities") { constrain(view) { view in view.right <= view.superview!.right view.right >= view.superview!.right } window.layoutIfNeeded() expect(view.frame.maxX).to(equal(400)) } it("should support addition") { constrain(view) { view in view.right == view.superview!.right + 100 } window.layoutIfNeeded() expect(view.frame.maxX).to(equal(500)) } it("should support subtraction") { constrain(view) { view in view.right == view.superview!.right - 100 } window.layoutIfNeeded() expect(view.frame.maxX).to(equal(300)) } } describe("LayoutProxy.bottom") { it("should support relative equalities") { constrain(view) { view in view.bottom == view.superview!.bottom } window.layoutIfNeeded() expect(view.frame.maxY).to(equal(400)) } it("should support relative inequalities") { constrain(view) { view in view.bottom <= view.superview!.bottom view.bottom >= view.superview!.bottom } window.layoutIfNeeded() expect(view.frame.maxY).to(equal(400)) } it("should support addition") { constrain(view) { view in view.bottom == view.superview!.bottom + 100 } window.layoutIfNeeded() expect(view.frame.maxY).to(equal(500)) } it("should support subtraction") { constrain(view) { view in view.bottom == view.superview!.bottom - 100 } window.layoutIfNeeded() expect(view.frame.maxY).to(equal(300)) } } describe("LayoutProxy.left") { it("should support relative equalities") { constrain(view) { view in view.left == view.superview!.left } window.layoutIfNeeded() expect(view.frame.minX).to(equal(0)) } it("should support relative inequalities") { constrain(view) { view in view.left <= view.superview!.left view.left >= view.superview!.left } window.layoutIfNeeded() expect(view.frame.minX).to(equal(0)) } it("should support addition") { constrain(view) { view in view.left == view.superview!.left + 100 } window.layoutIfNeeded() expect(view.frame.minX).to(equal(100)) } it("should support subtraction") { constrain(view) { view in view.left == view.superview!.left - 100 } window.layoutIfNeeded() expect(view.frame.minX).to(equal(-100)) } } describe("LayoutProxy.centerX") { it("should support relative equalities") { constrain(view) { view in view.centerX == view.superview!.centerX } window.layoutIfNeeded() expect(view.frame.midX).to(equal(200)) } it("should support relative inequalities") { constrain(view) { view in view.centerX <= view.superview!.centerX view.centerX >= view.superview!.centerX } window.layoutIfNeeded() expect(view.frame.midX).to(equal(200)) } it("should support addition") { constrain(view) { view in view.centerX == view.superview!.centerX + 100 } window.layoutIfNeeded() expect(view.frame.midX).to(equal(300)) } it("should support subtraction") { constrain(view) { view in view.centerX == view.superview!.centerX - 100 } window.layoutIfNeeded() expect(view.frame.midX).to(equal(100)) } it("should support multiplication") { constrain(view) { view in view.centerX == view.superview!.centerX * 2 } window.layoutIfNeeded() expect(view.frame.midX).to(equal(400)) } it("should support division") { constrain(view) { view in view.centerX == view.superview!.centerX / 2 } window.layoutIfNeeded() expect(view.frame.midX).to(equal(100)) } } describe("LayoutProxy.centerY") { it("should support relative equalities") { constrain(view) { view in view.centerY == view.superview!.centerY } window.layoutIfNeeded() expect(view.frame.midY).to(equal(200)) } it("should support relative inequalities") { constrain(view) { view in view.centerY <= view.superview!.centerY view.centerY >= view.superview!.centerY } window.layoutIfNeeded() expect(view.frame.midY).to(equal(200)) } it("should support addition") { constrain(view) { view in view.centerY == view.superview!.centerY + 100 } window.layoutIfNeeded() expect(view.frame.midY).to(equal(300)) } it("should support subtraction") { constrain(view) { view in view.centerY == view.superview!.centerY - 100 } window.layoutIfNeeded() expect(view.frame.midY).to(equal(100)) } it("should support multiplication") { constrain(view) { view in view.centerY == view.superview!.centerY * 2 } window.layoutIfNeeded() expect(view.frame.midY).to(equal(400)) } it("should support division") { constrain(view) { view in view.centerY == view.superview!.centerY / 2 } window.layoutIfNeeded() expect(view.frame.midY).to(equal(100)) } } #if os(iOS) || os(tvOS) describe("on iOS only") { beforeEach { window.layoutMargins = UIEdgeInsets(top: 10, left: 20, bottom: 30, right: 40) } describe("LayoutProxy.topMargin") { it("should support relative equalities") { constrain(view) { view in view.top == view.superview!.topMargin } window.layoutIfNeeded() expect(view.frame.minY).to(equal(10)) } } describe("LayoutProxy.rightMargin") { it("should support relative equalities") { constrain(view) { view in view.right == view.superview!.rightMargin } window.layoutIfNeeded() expect(view.frame.maxX).to(equal(360)) } } describe("LayoutProxy.bottomMargin") { it("should support relative equalities") { constrain(view) { view in view.bottom == view.superview!.bottomMargin } window.layoutIfNeeded() expect(view.frame.maxY).to(equal(370)) } } describe("LayoutProxy.leftMargin") { it("should support relative equalities") { constrain(view) { view in view.left == view.superview!.leftMargin } window.layoutIfNeeded() expect(view.frame.minX).to(equal(20)) } } } #endif } } ================================================ FILE: CartographyTests/EdgesSpec.swift ================================================ import Cartography import Nimble import Quick class EdgesSpec: QuickSpec { override func spec() { var window: TestWindow! var view: TestView! beforeEach { window = TestWindow(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) view = TestView(frame: CGRect.zero) window.addSubview(view) } describe("LayoutProxy.edges") { it("should support relative equalities") { constrain(view) { view in view.edges == view.superview!.edges } window.layoutIfNeeded() expect(view.frame).to(equal(view.superview?.frame)) } } describe("LayoutProxy.edges") { it("should support relative inequalities") { constrain(view) { view in view.edges <= view.superview!.edges view.edges >= view.superview!.edges } window.layoutIfNeeded() expect(view.frame).to(equal(view.superview?.frame)) } } describe("inset") { it("should inset all edges with the same amount") { constrain(view) { view in view.edges == inset(view.superview!.edges, 20) } window.layoutIfNeeded() expect(view.frame).to(equal(CGRect(x: 20, y: 20, width: 360, height: 360))) } it("should inset the horizontal and vertical edge individually") { constrain(view) { view in view.edges == inset(view.superview!.edges, 20, 30) } window.layoutIfNeeded() expect(view.frame).to(equal(CGRect(x: 20, y: 30, width: 360, height: 340))) } it("should inset the horizontal edges") { constrain(view) { view in view.edges == inset(view.superview!.edges, horizontally: 20) } window.layoutIfNeeded() expect(view.frame).to(equal(CGRect(x: 20, y: 0, width: 360, height: 400))) } it("should inset the vertical edges") { constrain(view) { view in view.edges == inset(view.superview!.edges, vertically: 30) } window.layoutIfNeeded() expect(view.frame).to(equal(CGRect(x: 0, y: 30, width: 400, height: 340))) } it("should inset all edges individually") { constrain(view) { view in view.edges == inset(view.superview!.edges, 10, 20, 30, 40) } window.layoutIfNeeded() expect(view.frame).to(equal(CGRect(x: 20, y: 10, width: 340, height: 360))) } } #if os(iOS) || os(tvOS) describe("on iOS only") { beforeEach { window.layoutMargins = UIEdgeInsets(top: 10, left: 20, bottom: 30, right: 40) } describe("LayoutProxy.edgesWithinMargins") { it("should support relative equalities") { constrain(view) { view in view.edges == view.superview!.edgesWithinMargins } window.layoutIfNeeded() expect(view.frame).to(equal(CGRect(x: 20, y: 10, width: 340, height: 360))) } } } #endif } } ================================================ FILE: CartographyTests/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1 ================================================ FILE: CartographyTests/LayoutGuideSpec.swift ================================================ // // LayoutGuideSpec.swift // Cartography-iOS // // Created by Vitor Travain on 16/10/17. // Copyright © 2017 Robert Böhnke. All rights reserved. // import Quick import Nimble @testable import Cartography @available(iOS, introduced: 9.0) @available(tvOS, introduced: 9.0) @available(OSX, introduced: 10.11) final class LayoutGuideSpec: QuickSpec { override func spec() { var view: View! var layoutGuide: LayoutGuide! beforeEach { view = View(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) #if os(OSX) view.autoresizingMask = .none #endif layoutGuide = LayoutGuide() view.addLayoutGuide(layoutGuide) } describe("LayoutGuideProxy") { it("should support relative equalities") { constrain(layoutGuide) { layoutGuide in layoutGuide.edges == layoutGuide.owningView!.edges } #if os(iOS) || os(tvOS) view.layoutIfNeeded() expect(layoutGuide.layoutFrame.origin.x) == 0 expect(layoutGuide.layoutFrame.origin.y) == 0 expect(layoutGuide.layoutFrame.width) == 400 expect(layoutGuide.layoutFrame.height) == 400 #elseif os(OSX) view.needsLayout = true view.layoutSubtreeIfNeeded() expect(layoutGuide.frame.origin.x) == 0 expect(layoutGuide.frame.origin.y) == 0 expect(layoutGuide.frame.width) == 400 expect(layoutGuide.frame.height) == 400 #endif } it("should support inequalities") { constrain(layoutGuide) { layoutGuide in layoutGuide.top >= layoutGuide.owningView!.top layoutGuide.bottom <= layoutGuide.owningView!.bottom layoutGuide.left >= layoutGuide.owningView!.left layoutGuide.right <= layoutGuide.owningView!.right layoutGuide.center == layoutGuide.owningView!.center ~ .defaultLow layoutGuide.width == 200 layoutGuide.height == 200 } #if os(iOS) || os(tvOS) view.layoutIfNeeded() expect(layoutGuide.layoutFrame.midX) == 200 expect(layoutGuide.layoutFrame.midY) == 200 expect(layoutGuide.layoutFrame.width) == 200 expect(layoutGuide.layoutFrame.height) == 200 #elseif os(OSX) view.needsLayout = true view.layoutSubtreeIfNeeded() expect(layoutGuide.frame.midX) == 200 expect(layoutGuide.frame.midY) == 200 expect(layoutGuide.frame.width) == 200 expect(layoutGuide.frame.height) == 200 #endif } it("should support addition") { constrain(layoutGuide) { layoutGuide in layoutGuide.leading == layoutGuide.owningView!.leading + 10 } #if os(iOS) || os(tvOS) view.layoutIfNeeded() expect(layoutGuide.layoutFrame.minX) == 10 #elseif os(OSX) view.needsLayout = true view.layoutSubtreeIfNeeded() expect(layoutGuide.frame.minX) == 10 #endif } it("should support subtraction") { constrain(layoutGuide) { layoutGuide in layoutGuide.trailing == layoutGuide.owningView!.trailing - 10 } #if os(iOS) || os(tvOS) view.layoutIfNeeded() expect(layoutGuide.layoutFrame.maxX) == 390 #elseif os(OSX) view.needsLayout = true view.layoutSubtreeIfNeeded() expect(layoutGuide.frame.maxX) == 390 #endif } it("should support multiplication") { constrain(layoutGuide) { layoutGuide in layoutGuide.width == 0.5 * layoutGuide.owningView!.width } #if os(iOS) || os(tvOS) view.layoutIfNeeded() expect(layoutGuide.layoutFrame.width) == 0.5 * view.frame.width #elseif os(OSX) view.needsLayout = true view.layoutSubtreeIfNeeded() expect(layoutGuide.frame.width) == 0.5 * view.frame.width #endif } it("should support division") { constrain(layoutGuide) { layoutGuide in layoutGuide.width == layoutGuide.owningView!.width / 2 } #if os(iOS) || os(tvOS) view.layoutIfNeeded() expect(layoutGuide.layoutFrame.width) == view.frame.width / 2 #elseif os(OSX) view.needsLayout = true view.layoutSubtreeIfNeeded() expect(layoutGuide.frame.width) == view.frame.width / 2 #endif } it("should support centering") { constrain(layoutGuide) { layoutGuide in layoutGuide.center == layoutGuide.owningView!.center } #if os(iOS) || os(tvOS) view.layoutIfNeeded() expect(layoutGuide.layoutFrame.midX) == 200 expect(layoutGuide.layoutFrame.midY) == 200 #elseif os(OSX) view.needsLayout = true view.layoutSubtreeIfNeeded() expect(layoutGuide.frame.midX) == 200 expect(layoutGuide.frame.midY) == 200 #endif } } } } ================================================ FILE: CartographyTests/LayoutSupportSpec.swift ================================================ import Cartography import Nimble import Quick import UIKit class LayoutSupportSpec: QuickSpec { override func spec() { var window: TestWindow! var view: TestView! var viewController: UIViewController! var navigationController: UINavigationController! var tabBarController: UITabBarController! beforeEach { window = TestWindow(frame: CGRect(x: 0,y: 0, width: 400, height: 400)) view = TestView(frame: CGRect.zero) viewController = UIViewController() viewController.view.addSubview(view) constrain(view) { view in view.height == 200 view.width == 200 } navigationController = UINavigationController(rootViewController: viewController) tabBarController = UITabBarController() tabBarController.viewControllers = [navigationController] tabBarController.view.frame = window.bounds tabBarController.view.layoutIfNeeded() window.rootViewController = tabBarController window.setNeedsLayout() window.layoutIfNeeded() print(viewController.topLayoutGuide) } describe("LayoutSupport.top") { it("should support relative equalities") { viewController.view.layoutIfNeeded() constrain(view, viewController.car_topLayoutGuide) { view, topLayoutGuide in view.top == topLayoutGuide.bottom } viewController.view.layoutIfNeeded() expect(view.convert(view.bounds, to: window).minY).to(equal(viewController.topLayoutGuide.length)) } it("should support relative inequalities") { constrain(view, viewController.car_topLayoutGuide) { view, topLayoutGuide in view.top <= topLayoutGuide.bottom view.top >= topLayoutGuide.bottom } viewController.view.layoutIfNeeded() expect(view.convert(view.bounds, to: window).minY).to(equal(viewController.topLayoutGuide.length)) } it("should support addition") { constrain(view, viewController.car_topLayoutGuide) { view, topGuide in view.top == topGuide.bottom + 100 } viewController.view.layoutIfNeeded() expect(view.convert(view.bounds, to: window).minY).to(equal(100 + viewController.topLayoutGuide.length)) } it("should support subtraction") { constrain(view, viewController.car_topLayoutGuide) { view, topGuide in view.top == topGuide.bottom - 100 } viewController.view.layoutIfNeeded() expect(view.convert(view.bounds, to: window).minY).to(equal(-100 - viewController.topLayoutGuide.length)) } } describe("LayoutSupport.bottom") { it("should support relative equalities") { constrain(view, viewController.car_bottomLayoutGuide) { view, bottomGuide in view.bottom == bottomGuide.top } viewController.view.layoutIfNeeded() expect(view.convert(view.bounds, to: window).maxY).to(equal(window.bounds.maxY - viewController.bottomLayoutGuide.length)) } it("should support relative inequalities") { constrain(view, viewController.car_bottomLayoutGuide) { view, bottomGuide in view.bottom <= bottomGuide.top view.bottom >= bottomGuide.top } viewController.view.layoutIfNeeded() expect(view.convert(view.bounds, to: window).maxY).to(equal(window.bounds.maxY - viewController.bottomLayoutGuide.length)) } it("should support addition") { constrain(view, viewController.car_bottomLayoutGuide) { view, bottomGuide in view.bottom == bottomGuide.top + 100 } viewController.view.layoutIfNeeded() expect(view.convert(view.bounds, to: window).maxY).to(equal(100 + window.bounds.maxY - viewController.bottomLayoutGuide.length)) } it("should support subtraction") { constrain(view, viewController.car_bottomLayoutGuide) { view, bottomGuide in view.bottom == bottomGuide.top - 100 } viewController.view.layoutIfNeeded() expect(view.convert(view.bounds, to: window).maxY).to(equal((window.bounds.maxY - 100) - viewController.bottomLayoutGuide.length)) } } } } ================================================ FILE: CartographyTests/Matchers.swift ================================================ import Cartography import Quick import Nimble public func translateAutoresizingMasksToConstraints() -> Predicate { return Predicate { expression -> PredicateResult in guard let view = try expression.evaluate() else { return PredicateResult(status: .fail, message: .fail("expected valid view, got ")) } return PredicateResult(bool: view.translatesAutoresizingMaskIntoConstraints, message: .expectedTo("translate autoresizing masks to constraints")) } } ================================================ FILE: CartographyTests/MemoryLeakSpec.swift ================================================ import Cartography import Nimble import Quick class MemoryLeakSpec: QuickSpec { override func spec() { describe("constrain") { it("should not leak memory") { weak var weak_superview: View? = .none weak var weak_viewA: View? = .none weak var weak_viewB: View? = .none autoreleasepool { let superview = View(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) let viewA: TestView = TestView(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) superview.addSubview(viewA) let viewB: TestView = TestView(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) superview.addSubview(viewB) weak_superview = superview weak_viewA = viewA weak_viewB = viewB constrain(viewA, viewB) { viewA, viewB in viewA.top == viewB.top viewB.bottom == viewA.bottom } } expect(weak_superview).to(beNil()) expect(weak_viewA).to(beNil()) expect(weak_viewB).to(beNil()) } } } } ================================================ FILE: CartographyTests/PointSpec.swift ================================================ import Cartography import Nimble import Quick class PointSpec: QuickSpec { override func spec() { var window: TestWindow! var view: TestView! beforeEach { window = TestWindow(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) view = TestView(frame: CGRect.zero) window.addSubview(view) constrain(view) { view in view.width == 200 view.height == 200 } } describe("LayoutProxy.center") { it("should support relative equalities") { constrain(view) { view in view.center == view.superview!.center } window.layoutIfNeeded() expect(view.frame).to(equal(CGRect(x: 100, y: 100, width: 200, height: 200))) } it("should support relative inequalities") { constrain(view) { view in view.center <= view.superview!.center view.center >= view.superview!.center } window.layoutIfNeeded() expect(view.frame).to(equal(CGRect(x: 100, y: 100, width: 200, height: 200))) } } #if os(iOS) || os(tvOS) describe("on iOS only") { beforeEach { view.layoutMargins = UIEdgeInsets(top: 10, left: 20, bottom: 30, right: 40) } describe("LayoutProxy.centerWithinMargins") { it("should support relative equalities") { constrain(view) { view in view.centerWithinMargins == view.superview!.center } window.layoutIfNeeded() expect(view.frame).to(equal(CGRect(x: 110, y: 110, width: 200, height: 200))) } it("should support relative inequalities") { constrain(view) { view in view.centerWithinMargins <= view.superview!.center view.centerWithinMargins >= view.superview!.center } window.layoutIfNeeded() expect(view.frame).to(equal(CGRect(x: 110, y: 110, width: 200, height: 200))) } } } #endif } } ================================================ FILE: CartographyTests/PrioritySpec.swift ================================================ import Cartography import Nimble import Quick class PrioritySpec: QuickSpec { override func spec() { var window: TestWindow! var view: TestView! beforeEach { window = TestWindow(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) view = TestView(frame: CGRect.zero) window.addSubview(view) } it("should operate on a single constraint") { var constraint: NSLayoutConstraint! constrain(view) { view in constraint = view.width == 200 ~ LayoutPriority(100) } expect(constraint.priority).to(equal(LayoutPriority(100))) } it("should operate on an array of constraints") { var constraints: [NSLayoutConstraint]! constrain(view) { view in constraints = (view.size <= view.superview!.size ~ LayoutPriority(100)) } expect(constraints[0].priority).to(equal(LayoutPriority(100))) expect(constraints[1].priority).to(equal(LayoutPriority(100))) } } } ================================================ FILE: CartographyTests/SizeSpec.swift ================================================ import Cartography import Nimble import Quick class SizeSpec: QuickSpec { override func spec() { var window: TestWindow! var view: TestView! beforeEach { window = TestWindow(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) view = TestView(frame: CGRect.zero) window.addSubview(view) } describe("LayoutProxy.size") { it("should support relative equalities") { constrain(view) { view in view.size == view.superview!.size } window.layoutIfNeeded() expect(view.frame.size).to(equal(CGSize(width: 400, height: 400))) } it("should support relative inequalities") { constrain(view) { view in view.size <= view.superview!.size view.size >= view.superview!.size } window.layoutIfNeeded() expect(view.frame.size).to(equal(CGSize(width: 400, height: 400))) } it("should support multiplication") { constrain(view) { view in view.size == view.superview!.size * 2 } window.layoutIfNeeded() expect(view.frame.size).to(equal(CGSize(width: 800, height: 800))) } it("should support division") { constrain(view) { view in view.size == view.superview!.size / 2 } window.layoutIfNeeded() expect(view.frame.size).to(equal(CGSize(width: 200, height: 200))) } } } } ================================================ FILE: CartographyTests/TestView.swift ================================================ // // TestView.swift // Cartography // // Created by Robert Böhnke on 21/03/15. // Copyright (c) 2015 Robert Böhnke. All rights reserved. // import Cartography class TestView: View { override init(frame: CGRect) { super.init(frame: frame) translatesAutoresizingMaskIntoConstraints = false } required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } #if os(OSX) override var isFlipped: Bool { return true } func layoutIfNeeded() { (superview ?? self).layoutSubtreeIfNeeded() } #endif } #if os(iOS) || os(tvOS) class TestWindow: UIWindow { override var safeAreaInsets: UIEdgeInsets { return .zero } } #else class TestWindow: TestView { } #endif ================================================ FILE: CartographyTests/ViewHierarchySpec.swift ================================================ import Cartography import Nimble import Quick class ViewHierarchySpec: QuickSpec { override func spec() { describe("Finding the common superview") { pending("should throw an exception if the views share no common ancestor") { let viewA = TestView() let viewB = TestView() expect({ constrain(viewA, viewB) { viewA, viewB in viewA.width == viewB.width } }()).to(raiseException()) } it("should consider a view its own closest common ancestor") { let view = TestView() constrain(view) { view in view.width == 200 } expect(view.constraints.count).to(equal(1)) } it("should handle a direct parent-child-relationship") { let parent = TestView() let child = TestView() parent.addSubview(child) constrain(parent, child) { parent, child in parent.width == child.width } expect(parent.constraints.count).to(equal(1)) } it("should handle a grandparent-child-relationship") { let grandparent = TestView() let parent = TestView() let child = TestView() grandparent.addSubview(parent) parent.addSubview(child) constrain(grandparent, child) { grandparent, child in grandparent.width == child.width } expect(grandparent.constraints.count).to(equal(1)) } it("should handle views that share a parent") { let parent = TestView() let childA = TestView() let childB = TestView() parent.addSubview(childA) parent.addSubview(childB) constrain(childA, childB) { childA, childB in childA.width == childB.width } expect(parent.constraints.count).to(equal(1)) } it("should handle views that share a grandparent") { let grandparent = TestView() let parentA = TestView() let parentB = TestView() let childA = TestView() let childB = TestView() grandparent.addSubview(parentA) grandparent.addSubview(parentB) parentA.addSubview(childA) parentB.addSubview(childB) constrain(childA, childB) { childA, childB in childA.width == childB.width } expect(grandparent.constraints.count).to(equal(1)) } it("should handle asymmetric view hierachies") { let grandparent = TestView() let parentA = TestView() let parentB = TestView() let childA = TestView() grandparent.addSubview(parentA) grandparent.addSubview(parentB) parentA.addSubview(childA) constrain(childA, parentB) { childA, parentB in childA.width == parentB.width } expect(grandparent.constraints.count).to(equal(1)) } } } } ================================================ FILE: CartographyTests/ViewLayoutGuideSpec.swift ================================================ // // SafeAreaLayoutGuideSpec.swift // Cartography // // Created by Vitor Travain on 17/10/17. // Copyright © 2017 Robert Böhnke. All rights reserved. // import UIKit import Quick import Nimble @testable import Cartography @available(iOS, introduced: 9.0) final class ViewLayoutGuideSpec: QuickSpec { override func spec() { describe("Layout margin guide") { var superview: UIView! var view: UIView! beforeEach { superview = UIView(frame: UIScreen.main.bounds) view = UIView(frame: .zero) superview.addSubview(view) } it("Views should align to edges within margins") { constrain(view) { view in view.edges == view.superview!.layoutMarginsGuide.edges } superview.layoutIfNeeded() expect(view.frame.minX) == superview.layoutMarginsGuide.layoutFrame.minX expect(view.frame.minY) == superview.layoutMarginsGuide.layoutFrame.minY expect(view.frame.width) == superview.layoutMarginsGuide.layoutFrame.width expect(view.frame.height) == superview.layoutMarginsGuide.layoutFrame.height } it("Views should center within margins") { constrain(view) { view in view.center == view.superview!.layoutMarginsGuide.center view.width == 200 view.height == 200 } superview.layoutIfNeeded() expect(view.frame.midX) == (superview.layoutMarginsGuide.layoutFrame.midX) expect(view.frame.midY) == (superview.layoutMarginsGuide.layoutFrame.midY) expect(view.frame.width) == 200 expect(view.frame.height) == 200 } } describe("Readable content guide") { var superview: UIView! var view: UIView! beforeEach { superview = UIView(frame: UIScreen.main.bounds) view = UIView(frame: .zero) superview.addSubview(view) } it("Views should align to edges within readable margins") { constrain(view) { view in view.edges == view.superview!.readableContentGuide.edges } superview.layoutIfNeeded() expect(view.frame.minX) == superview.readableContentGuide.layoutFrame.minX expect(view.frame.minY) == superview.readableContentGuide.layoutFrame.minY expect(view.frame.width) == superview.readableContentGuide.layoutFrame.width expect(view.frame.height) == superview.readableContentGuide.layoutFrame.height } it("Views should center within readable margins") { constrain(view) { view in view.center == view.superview!.readableContentGuide.center view.width == 200 view.height == 200 } superview.layoutIfNeeded() expect(view.frame.midX) == (superview.readableContentGuide.layoutFrame.midX) expect(view.frame.midY) == (superview.readableContentGuide.layoutFrame.midY) expect(view.frame.width) == 200 expect(view.frame.height) == 200 } } } } @available(iOS, introduced: 11.0) @available(tvOS, introduced: 11.0) final class SafeAreaLayoutGuideSpec: QuickSpec { override func spec() { describe("Safe area layout guide") { var superview: UIView! var view: UIView! beforeEach { superview = TestView(frame: UIScreen.main.bounds) view = TestView(frame: CGRect.zero) superview.addSubview(view) } it("Views should align to safe area edges") { constrain(view) { view in view.edges == view.superview!.safeAreaLayoutGuide.edges } superview.layoutIfNeeded() expect(view.frame.minX) == (superview.safeAreaLayoutGuide.layoutFrame.minX) expect(view.frame.minY) == (superview.safeAreaLayoutGuide.layoutFrame.maxX) expect(view.frame.width) == (superview.safeAreaLayoutGuide.layoutFrame.width) expect(view.frame.height) == (superview.safeAreaLayoutGuide.layoutFrame.height) } it("View should center in safe area") { constrain(view) { view in view.center == view.superview!.safeAreaLayoutGuide.center view.width == 200 view.height == 200 } superview.layoutIfNeeded() expect(view.frame.midX) == (superview.safeAreaLayoutGuide.layoutFrame.midX) expect(view.frame.midY) == (superview.safeAreaLayoutGuide.layoutFrame.midY) expect(view.frame.width) == 200 expect(view.frame.height) == 200 } } } } ================================================ FILE: CartographyTests/ViewProxyTests.swift ================================================ // // ViewProxyTests.swift // Cartography-iOS-Tests // // Created by Luís Portela on 01/10/2018. // Copyright © 2018 Robert Böhnke. All rights reserved. // import Nimble import Quick import UIKit @testable import Cartography @available(iOS, introduced: 9.0) @available(tvOS, introduced: 9.0) final class ViewProxyTestsSpec: QuickSpec { override func spec() { describe("ViewProxy SafeArea Layout Guide") { let view: UIView = UIView(frame: .zero) constrain(view) { testingView in if #available(iOS 11, *), #available(tvOS 11, *) { context("When running on iOS 11+ devices") { it("safeArea should be SafeAreaLayoutGuide") { expect(testingView.safeArea.item).to(beIdenticalTo(testingView.safeAreaLayoutGuide.item)) } } } else { context("When runnig prior versions of iOS 11") { it("safeArea should be LayoutMarginsGuide") { expect(testingView.safeArea.item).to(beIdenticalTo(testingView.layoutMarginsGuide.item)) } } } } } } } ================================================ FILE: LICENSE ================================================ Copyright (c) 2014 Robert Böhnke Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. This license does not apply to the contents of the images folder. --- This project uses portions of code from FLKAutoLayout, copyright (c) 2013 Florian Kugler Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Package.swift ================================================ // swift-tools-version:4.2 import PackageDescription let package = Package( name: "Cartography", // platforms: [.iOS("8.0"), .macOS("10.10"), tvOS("9.0"), .watchOS("2.0")], products: [ .library(name: "Cartography", targets: ["Cartography"]) ], targets: [ .target( name: "Cartography", path: "Cartography" ) ] ) ================================================ FILE: Podfile ================================================ use_frameworks! abstract_target "TestPods" do pod 'Nimble', :git => 'https://github.com/Quick/Nimble.git' pod 'Quick', :git => 'https://github.com/Quick/Quick.git' target 'Cartography-iOS-Tests' do platform :ios, '8.0' end target 'Cartography-Mac-Tests' do platform :osx, '10.10' end target 'Cartography-tvOS-tests' do platform :tvos, '9.0' end end ================================================ FILE: README.md ================================================ # Cartography :iphone::triangular_ruler: Using Cartography, you can set up your Auto Layout constraints in declarative code and without any stringly typing! In short, it allows you to replace this: ```Swift addConstraint(NSLayoutConstraint( item: button1, attribute: .Right, relatedBy: .Equal, toItem: button2, attribute: .Left, multiplier: 1.0, constant: -12.0 )) ``` with this ```Swift constrain(button1, button2) { button1, button2 in button1.right == button2.left - 12 } ``` If you end up using Cartography in production, I'd love to hear from you. You can reach me through [Twitter] or [email]. ## Installation ### CocoaPods To integrate Cartography into your Xcode project using CocoaPods, specify it in your `Podfile`: ```ruby target '' do pod 'Cartography', '~> 3.0' end ``` Then, run the following command: ```bash $ pod install ``` ## Usage Call the `constrain`_*_ function with your `UIView` or `NSView` instances as well as a closure in which you declare the constraints between the different attributes of your views: ```swift constrain(view1, view2) { view1, view2 in view1.width == (view1.superview!.width - 50) * 0.5 view2.width == view1.width - 50 view1.height == 40 view2.height == view1.height view1.centerX == view1.superview!.centerX view2.centerX == view1.centerX view1.top >= view1.superview!.top + 20 view2.top == view1.bottom + 20 } ``` For every view on the left hand side of an equality or inequality operator, Cartography will automatically set its `translatesAutoresizingMaskIntoConstraints` property to `false`. If the view is not controlled by you–for example _if it belongs to a Apple-provided `UIViewController` class_–you should take appropriate care when declaring its constraints.

## Replacing constraints You can capture multiple constraints in a group to then replace them with new constraints at a later point. ```swift constrain(view) { view in view.width == 100 view.height == 100 } let group = ConstraintGroup() // Attach `view` to the top left corner of its superview constrain(view, replace: group) { view in view.top == view.superview!.top view.left == view.superview!.left } /* Later */ // Move the view to the bottom right corner of its superview constrain(view, replace: group) { view in view.bottom == view.superview!.bottom view.right == view.superview!.right } UIView.animate(withDuration: 0.5, animations: view.layoutIfNeeded) ``` For convenience, the `constrain` functions also returns `ConstraintGroup` instances: ```swift let group = constrain(button) { button in button.width == 100 button.height == 400 } ``` ## Supported attributes Cartography supports all built-in attributes as of iOS 8 and OS X 10.9, those are: - `width` - `height` - `top` - `right` - `bottom` - `left` - `leading` - `trailing` - `centerX` - `centerY` - `baseline` as well as the iOS specific - `firstBaseline` - `leftMargin` - `rightMargin` - `topMargin` - `bottomMargin` - `leadingMargin` - `trailingMargin` - `centerXWithinMargins` - `centerYWithinMargins` - `edgesWithinMargins` These can be further refined using the following operators: `*`, `/`, `+` and `-`. Additionally, it supports convenient compound attributes that allow you to assign multiple attributes at once: ```swift constrain(view) { view in view.size == view.superview!.size / 2 view.center == view.superview!.center } ``` ```swift constrain(view) { view in view.edges == inset(view.superview!.edges, 20, 20, 40, 20) } ``` ### Aligning multiple view If you need to align multiple views by a common edge, you can use the `align` functions: ```swift constrain(view1, view2, view3) { view1, view2, view3 in align(top: view1, view2, view3) } ``` Which is equivalent to `view1.top == view2.top; view2.top == view3.top`. Similar variants exist for `top`, `right` `bottom`, `left`, `leading`, `trailing`, `centerX`, `centerY` and `baseline`. ### Distributing views evenly For distributing multiple views, either horizontally or vertically, you can use the `distribute` functions: ```swift constrain(view1, view2, view3) { view1, view2, view3 in distribute(by: 10, horizontally: view1, view2, view3) } ``` Which is equivalent to `view1.trailing == view2.leading - 10; view2.trailing == view3.leading - 10`. ## Setting priorities You can set the priorities of your constraints using the `~` operator: ```swift constrain(view) { view in view.width >= 200 ~ UILayoutPriority(100) view.height >= 200 ~ .required } ``` ## Capturing constraints Since the `==`, `>=`, `<=` and `~` emit `NSLayoutConstraint` instances, you can capture their results if you need to refer to the layout constraints at a later time: ```swift var width: NSLayoutConstraint? constrain(view) { view in width = (view.width == 200 ~ 100) } ``` Note that declaring compound attributes returns multiple constraints at once: ```swift var constraints: [NSLayoutConstraint]? constrain(view) { view in constraints = (view.size == view.superview!.size ~ .defaultLow) } ``` ## Documentation Read the documentation [here](http://robb.github.io/Cartography/). For more information, see the [gh-pages](https://github.com/robb/Cartography/tree/gh-pages) branch. \* Since Xcode 11 and swift 5.1 the keyword `constrain` conflicts with the ones used by the **CommonUISDK**... so, Calling the function with the module name is necessary to make it work properly e.g.: `Cartography.constrain` If you're using it with Xcode 10.3 or earlier, you can still use it as it is, without the module name alongside the function. ## Versioning For *Swift 3.x*: Versions <= 1.1.0 For *Swift 4.x*: Versions >= 2.0.0 For *Swift 5.x*: Versions >= 4.0.0 ## Support Please, don't hesitate to [file an issue](https://github.com/robb/Cartography/issues/new) if you have questions. ## About Cartography Cartography was built by [Robb Böhnke][me], is maintained by [Orta Therox][ot] and was inspired by the excellent [FLKAutoLayout] by [Florian Kugler][florian]. [flkautolayout]: https://github.com/floriankugler/FLKAutoLayout [florian]: https://github.com/floriankugler [me]: http://robb.is [twitter]: https://twitter.com/dlx [email]: mailto:robb@robb.is [ot]: https://github.com/orta