Add availability check for iOS 8 attributes.

This commit is contained in:
Suyeol Jeon 2015-09-14 22:31:55 +09:00
parent 1754ffd536
commit 8e6219ef86
1 changed files with 28 additions and 26 deletions

View File

@ -125,6 +125,7 @@ internal struct ConstraintAttributes: OptionSetType, BooleanType {
attrs.append(.Baseline) attrs.append(.Baseline)
} }
#if os(iOS) #if os(iOS)
if #available(iOS 8.0, *) {
if (self.contains(ConstraintAttributes.FirstBaseline)) { if (self.contains(ConstraintAttributes.FirstBaseline)) {
attrs.append(.FirstBaseline) attrs.append(.FirstBaseline)
} }
@ -152,6 +153,7 @@ internal struct ConstraintAttributes: OptionSetType, BooleanType {
if (self.contains(ConstraintAttributes.CenterYWithinMargins)) { if (self.contains(ConstraintAttributes.CenterYWithinMargins)) {
attrs.append(.CenterYWithinMargins) attrs.append(.CenterYWithinMargins)
} }
}
#endif #endif
return attrs return attrs
} }