diff --git a/Source/ConstraintMaker.swift b/Source/ConstraintMaker.swift index cefa31f..0749104 100644 --- a/Source/ConstraintMaker.swift +++ b/Source/ConstraintMaker.swift @@ -152,9 +152,9 @@ public class ConstraintMaker { return ConstraintMakerExtendable(description) } - internal static func prepareConstraints(view: ConstraintView, closure: @noescape(make: ConstraintMaker) -> Void) -> [Constraint] { + internal static func prepareConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { let maker = ConstraintMaker(view: view) - closure(make: maker) + closure(maker) let constraints = maker.descriptions .map { $0.constraint } .filter { $0 != nil } @@ -162,9 +162,9 @@ public class ConstraintMaker { return constraints } - internal static func makeConstraints(view: ConstraintView, closure: @noescape(make: ConstraintMaker) -> Void) { + internal static func makeConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) { let maker = ConstraintMaker(view: view) - closure(make: maker) + closure(maker) let constraints = maker.descriptions .map { $0.constraint } .filter { $0 != nil } @@ -174,14 +174,14 @@ public class ConstraintMaker { } } - internal static func remakeConstraints(view: ConstraintView, closure: @noescape(make: ConstraintMaker) -> Void) { + internal static func remakeConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) { self.removeConstraints(view: view) self.makeConstraints(view: view, closure: closure) } - internal static func updateConstraints(view: ConstraintView, closure: @noescape(make: ConstraintMaker) -> Void) { + internal static func updateConstraints(view: ConstraintView, closure: (_ make: ConstraintMaker) -> Void) { let maker = ConstraintMaker(view: view) - closure(make: maker) + closure(maker) let constraints = maker.descriptions .map { $0.constraint } .filter { $0 != nil } diff --git a/Source/ConstraintView+Extensions.swift b/Source/ConstraintView+Extensions.swift index 928eabb..b9634e7 100644 --- a/Source/ConstraintView+Extensions.swift +++ b/Source/ConstraintView+Extensions.swift @@ -121,22 +121,22 @@ public extension ConstraintView { public var snp_centerWithinMargins: ConstraintItem { return self.snp.centerWithinMargins } @available(*, deprecated:0.40.0, message:"Use newer snp.* syntax.") - public func snp_prepareConstraints(_ closure: @noescape(make: ConstraintMaker) -> Void) -> [Constraint] { + public func snp_prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { return self.snp.prepareConstraints(closure) } @available(*, deprecated:0.40.0, message:"Use newer snp.* syntax.") - public func snp_makeConstraints(_ closure: @noescape(make: ConstraintMaker) -> Void) { + public func snp_makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { self.snp.makeConstraints(closure) } @available(*, deprecated:0.40.0, message:"Use newer snp.* syntax.") - public func snp_remakeConstraints(_ closure: @noescape(make: ConstraintMaker) -> Void) { + public func snp_remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { self.snp.remakeConstraints(closure) } @available(*, deprecated:0.40.0, message:"Use newer snp.* syntax.") - public func snp_updateConstraints(_ closure: @noescape(make: ConstraintMaker) -> Void) { + public func snp_updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { self.snp.updateConstraints(closure) } diff --git a/Source/ConstraintViewDSL.swift b/Source/ConstraintViewDSL.swift index 7d5f136..ef3d6b1 100644 --- a/Source/ConstraintViewDSL.swift +++ b/Source/ConstraintViewDSL.swift @@ -148,19 +148,19 @@ public struct ConstraintViewDSL { } @discardableResult - public func prepareConstraints(_ closure: @noescape (make: ConstraintMaker) -> Void) -> [Constraint] { + public func prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] { return ConstraintMaker.prepareConstraints(view: self.view, closure: closure) } - public func makeConstraints(_ closure: @noescape (make: ConstraintMaker) -> Void) { + public func makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { ConstraintMaker.makeConstraints(view: self.view, closure: closure) } - public func remakeConstraints(_ closure: @noescape (make: ConstraintMaker) -> Void) { + public func remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { ConstraintMaker.remakeConstraints(view: self.view, closure: closure) } - public func updateConstraints(_ closure: @noescape (make: ConstraintMaker) -> Void) { + public func updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) { ConstraintMaker.updateConstraints(view: self.view, closure: closure) } diff --git a/Source/Debugging.swift b/Source/Debugging.swift index ff3a8a2..be8bb9e 100644 --- a/Source/Debugging.swift +++ b/Source/Debugging.swift @@ -138,10 +138,10 @@ private func conditionalOptional(from object: T) -> Optional { } private func descriptionForObject(_ object: AnyObject) -> String { - let pointerDescription = NSString(format: "%p", UInt(ObjectIdentifier(object))) + let pointerDescription = String(format: "%p", UInt(bitPattern: ObjectIdentifier(object))) var desc = "" - desc += object.dynamicType.description() + desc += type(of: object).description() if let object = object as? ConstraintView { desc += ":\(object.snp.label ?? pointerDescription)"