diff --git a/Source/ConstraintAttributes.swift b/Source/ConstraintAttributes.swift index 06b3dec..e19b18b 100644 --- a/Source/ConstraintAttributes.swift +++ b/Source/ConstraintAttributes.swift @@ -125,32 +125,34 @@ internal struct ConstraintAttributes: OptionSetType, BooleanType { attrs.append(.Baseline) } #if os(iOS) - if (self.contains(ConstraintAttributes.FirstBaseline)) { - attrs.append(.FirstBaseline) - } - if (self.contains(ConstraintAttributes.LeftMargin)) { - attrs.append(.LeftMargin) - } - if (self.contains(ConstraintAttributes.RightMargin)) { - attrs.append(.RightMargin) - } - if (self.contains(ConstraintAttributes.TopMargin)) { - attrs.append(.TopMargin) - } - if (self.contains(ConstraintAttributes.BottomMargin)) { - attrs.append(.BottomMargin) - } - if (self.contains(ConstraintAttributes.LeadingMargin)) { - attrs.append(.LeadingMargin) - } - if (self.contains(ConstraintAttributes.TrailingMargin)) { - attrs.append(.TrailingMargin) - } - if (self.contains(ConstraintAttributes.CenterXWithinMargins)) { - attrs.append(.CenterXWithinMargins) - } - if (self.contains(ConstraintAttributes.CenterYWithinMargins)) { - attrs.append(.CenterYWithinMargins) + if #available(iOS 8.0, *) { + if (self.contains(ConstraintAttributes.FirstBaseline)) { + attrs.append(.FirstBaseline) + } + if (self.contains(ConstraintAttributes.LeftMargin)) { + attrs.append(.LeftMargin) + } + if (self.contains(ConstraintAttributes.RightMargin)) { + attrs.append(.RightMargin) + } + if (self.contains(ConstraintAttributes.TopMargin)) { + attrs.append(.TopMargin) + } + if (self.contains(ConstraintAttributes.BottomMargin)) { + attrs.append(.BottomMargin) + } + if (self.contains(ConstraintAttributes.LeadingMargin)) { + attrs.append(.LeadingMargin) + } + if (self.contains(ConstraintAttributes.TrailingMargin)) { + attrs.append(.TrailingMargin) + } + if (self.contains(ConstraintAttributes.CenterXWithinMargins)) { + attrs.append(.CenterXWithinMargins) + } + if (self.contains(ConstraintAttributes.CenterYWithinMargins)) { + attrs.append(.CenterYWithinMargins) + } } #endif return attrs