Parcourir la source

Fixes for RawOptionSetType changes in beta 6.

James Power il y a 11 ans
Parent
commit
4dde1a8578
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      Snappy/Constraint.swift

+ 2 - 1
Snappy/Constraint.swift

@@ -31,7 +31,7 @@ import AppKit
 /**
  * ConstraintAttributes is an options set that maps to NSLayoutAttributes.
  */
-struct ConstraintAttributes: RawOptionSetType {
+struct ConstraintAttributes: RawOptionSetType, BooleanType {
 
     var value: UInt
     var boolValue: Bool {
@@ -43,6 +43,7 @@ struct ConstraintAttributes: RawOptionSetType {
     }
     func toRaw() -> UInt { return self.value }
     func getLogicValue() -> Bool { return self.value != 0 }
+    static var allZeros: ConstraintAttributes { return self(0) }
     static func fromRaw(raw: UInt) -> ConstraintAttributes? { return self(raw) }
     static func fromMask(raw: UInt) -> ConstraintAttributes { return self(raw) }
     static func convertFromNilLiteral() -> ConstraintAttributes { return self(0) }