robb / Cartography

A declarative Auto Layout DSL for Swift :iphone::triangular_ruler:
Other
7.35k stars 524 forks source link

Issues building the latest version #302

Open SirWellington opened 5 years ago

SirWellington commented 5 years ago

Trying to build this using Carthage on XCode 9.4.1.

Getting the following errors:

public typealias LayoutAttribute = NSLayoutConstraint.Attribute
                                   ~~~~~~~~~~~~~~~~~~ ^
/Users/wellington/Documents/Code/Censio/iOS/censio-ios-app/Code/Carthage/Checkouts/Cartography/Cartography/Context.swift:12:54: error: 'Relation' is not a member type of 'NSLayoutConstraint'
public typealias LayoutRelation = NSLayoutConstraint.Relation
                                  ~~~~~~~~~~~~~~~~~~ ^
/Users/wellington/Documents/Code/Censio/iOS/censio-ios-app/Code/Carthage/Checkouts/Cartography/Cartography/LayoutProxy.swift:18:64: error: 'Attribute' is not a member type of 'NSLayoutConstraint'
    internal func dimension(with attribute: NSLayoutConstraint.Attribute) -> Dimension {
                                            ~~~~~~~~~~~~~~~~~~ ^
/Users/wellington/Documents/Code/Censio/iOS/censio-ios-app/Code/Carthage/Checkouts/Cartography/Cartography/LayoutProxy.swift:22:59: error: 'Attribute' is not a member type of 'NSLayoutConstraint'
    internal func edge(with attribute: NSLayoutConstraint.Attribute) -> Edge {
                                       ~~~~~~~~~~~~~~~~~~ ^

Did you mean to use NSLayoutAttribute.

Help!

Monkey-D-Mark commented 5 years ago

I got this errors as well. It's ok in Xcode 10, appears in Xcode 10.1 beta2 anyone can help?

uhavemysword commented 5 years ago

Same issue,Help!

timdonnelly commented 5 years ago

For anyone still having trouble with this: NSLayoutAttribute was renamed to NSLayoutConstraint.Attribute in Swift 4.2.

I opened a PR to add swift_version = 4.2 to the podspec, which will remove the requirement that Cartography is integrated into a target that also uses 4.2 (for those using Cocoapods, at least).