Search code examples
iosswiftnslayoutconstraint

NSLayoutConstraint has no member 'Attribute'


I am trying to convert swift code in following

NSLayoutConstraint.Attribute.height

I am using SkeletonView which it throws me error while executing.

I was not able to find the new replacement syntax of that

Type 'NSLayoutConstraint' has no member 'Attribute'


Solution

  • It all depends on the version of Swift you are using.

    NSLayoutConstraint.Attribute.height // Swift 4.2
    
    NSLayoutAttribute.height // Swift 3.0+
    
    NSLayoutAttributeHeight // Swift 2?