Xcode 8 - Beta 6

This commit is contained in:
Robert Payne 2016-08-16 22:53:27 +12:00
parent a772f08051
commit 79137bce68
4 changed files with 17 additions and 17 deletions

View File

@ -152,9 +152,9 @@ public class ConstraintMaker {
return ConstraintMakerExtendable(description) 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) let maker = ConstraintMaker(view: view)
closure(make: maker) closure(maker)
let constraints = maker.descriptions let constraints = maker.descriptions
.map { $0.constraint } .map { $0.constraint }
.filter { $0 != nil } .filter { $0 != nil }
@ -162,9 +162,9 @@ public class ConstraintMaker {
return constraints 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) let maker = ConstraintMaker(view: view)
closure(make: maker) closure(maker)
let constraints = maker.descriptions let constraints = maker.descriptions
.map { $0.constraint } .map { $0.constraint }
.filter { $0 != nil } .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.removeConstraints(view: view)
self.makeConstraints(view: view, closure: closure) 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) let maker = ConstraintMaker(view: view)
closure(make: maker) closure(maker)
let constraints = maker.descriptions let constraints = maker.descriptions
.map { $0.constraint } .map { $0.constraint }
.filter { $0 != nil } .filter { $0 != nil }

View File

@ -121,22 +121,22 @@ public extension ConstraintView {
public var snp_centerWithinMargins: ConstraintItem { return self.snp.centerWithinMargins } public var snp_centerWithinMargins: ConstraintItem { return self.snp.centerWithinMargins }
@available(*, deprecated:0.40.0, message:"Use newer snp.* syntax.") @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) return self.snp.prepareConstraints(closure)
} }
@available(*, deprecated:0.40.0, message:"Use newer snp.* syntax.") @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) self.snp.makeConstraints(closure)
} }
@available(*, deprecated:0.40.0, message:"Use newer snp.* syntax.") @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) self.snp.remakeConstraints(closure)
} }
@available(*, deprecated:0.40.0, message:"Use newer snp.* syntax.") @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) self.snp.updateConstraints(closure)
} }

View File

@ -148,19 +148,19 @@ public struct ConstraintViewDSL {
} }
@discardableResult @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) 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) 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) 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) ConstraintMaker.updateConstraints(view: self.view, closure: closure)
} }

View File

@ -138,10 +138,10 @@ private func conditionalOptional<T>(from object: T) -> Optional<T> {
} }
private func descriptionForObject(_ object: AnyObject) -> String { 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 = "" var desc = ""
desc += object.dynamicType.description() desc += type(of: object).description()
if let object = object as? ConstraintView { if let object = object as? ConstraintView {
desc += ":\(object.snp.label ?? pointerDescription)" desc += ":\(object.snp.label ?? pointerDescription)"