diff --git a/Source/Constraint.swift b/Source/Constraint.swift index 90b532e..45f6014 100644 --- a/Source/Constraint.swift +++ b/Source/Constraint.swift @@ -201,7 +201,7 @@ public class Constraint { #endif // set install info - self.installInfo = ConstraintInstallInfo(view: installOnView, layoutConstraints: HashTable.weakObjects()) + self.installInfo = ConstraintInstallInfo(view: installOnView, layoutConstraints: NSHashTable.weakObjects()) // store which layout constraints are installed for this constraint for layoutConstraint in newLayoutConstraints { @@ -219,8 +219,8 @@ public class Constraint { self.installInfo = nil } - guard let installedLayoutConstraints = self.installInfo?.layoutConstraints.allObjects as? [LayoutConstraint] - where installedLayoutConstraints.count > 0 else { + guard let installedLayoutConstraints = self.installInfo?.layoutConstraints.allObjects as? [LayoutConstraint], + installedLayoutConstraints.count > 0 else { return } @@ -250,9 +250,9 @@ public class Constraint { } #endif - guard let layoutConstraints = self.installInfo?.layoutConstraints.allObjects as? [LayoutConstraint] - where layoutConstraints.count > 0 else { - return + guard let layoutConstraints = self.installInfo?.layoutConstraints.allObjects as? [LayoutConstraint], + layoutConstraints.count > 0 else { + return } NSLayoutConstraint.activate(layoutConstraints) @@ -265,9 +265,9 @@ public class Constraint { } #endif - guard let layoutConstraints = self.installInfo?.layoutConstraints.allObjects as? [LayoutConstraint] - where layoutConstraints.count > 0 else { - return + guard let layoutConstraints = self.installInfo?.layoutConstraints.allObjects as? [LayoutConstraint], + layoutConstraints.count > 0 else { + return } NSLayoutConstraint.deactivate(layoutConstraints) @@ -278,9 +278,9 @@ public class Constraint { private final class ConstraintInstallInfo { private weak var view: ConstraintView? = nil - private let layoutConstraints: HashTable + private let layoutConstraints: NSHashTable - private init(view: ConstraintView?, layoutConstraints: HashTable) { + private init(view: ConstraintView?, layoutConstraints: NSHashTable) { self.view = view self.layoutConstraints = layoutConstraints } diff --git a/Source/ConstraintAttributes.swift b/Source/ConstraintAttributes.swift index 89d7eab..3c4cf68 100644 --- a/Source/ConstraintAttributes.swift +++ b/Source/ConstraintAttributes.swift @@ -28,7 +28,7 @@ #endif -internal struct ConstraintAttributes: OptionSet, Boolean { +internal struct ConstraintAttributes: OptionSet { internal init(rawValue: UInt) { self.rawValue = rawValue diff --git a/Source/ConstraintItem.swift b/Source/ConstraintItem.swift index 6ff291e..83733b5 100644 --- a/Source/ConstraintItem.swift +++ b/Source/ConstraintItem.swift @@ -56,8 +56,8 @@ public func ==(lhs: ConstraintItem, rhs: ConstraintItem) -> Bool { // must both have valid targets and identical attributes guard let target1 = lhs.target, - let target2 = rhs.target - where target1 === target2 && lhs.attributes == rhs.attributes else { + let target2 = rhs.target, + target1 === target2 && lhs.attributes == rhs.attributes else { return false } diff --git a/Source/Debugging.swift b/Source/Debugging.swift index e4bec9f..ff3a8a2 100644 --- a/Source/Debugging.swift +++ b/Source/Debugging.swift @@ -62,7 +62,7 @@ public extension LayoutConstraint { if self.constant > 0.0 { description += " + \(self.constant)" } else if self.constant < 0.0 { - description += " - \(CGFloat.abs(self.constant))" + description += " - \(abs(self.constant))" } }