From 4dde1a8578142d134c558d19d7c4393a7e2c9e2a Mon Sep 17 00:00:00 2001 From: James Power Date: Mon, 25 Aug 2014 14:14:25 -0400 Subject: [PATCH] Fixes for RawOptionSetType changes in beta 6. --- Snappy/Constraint.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Snappy/Constraint.swift b/Snappy/Constraint.swift index f7bd4bd..145f1ea 100644 --- a/Snappy/Constraint.swift +++ b/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) }