Merge pull request #69 from Reflejo/closure-noescape

@noescape on methods
This commit is contained in:
Robert Payne 2015-04-11 17:07:12 +12:00
commit 237cd57409
2 changed files with 8 additions and 8 deletions

View File

@ -61,13 +61,13 @@ public class ConstraintMaker {
return constraint return constraint
} }
internal class func prepareConstraints(view: View, block: (make: ConstraintMaker) -> Void) -> Array<Constraint> { internal class func prepareConstraints(view: View, @noescape block: (make: ConstraintMaker) -> Void) -> Array<Constraint> {
let maker = ConstraintMaker(view: view) let maker = ConstraintMaker(view: view)
block(make: maker) block(make: maker)
return maker.constraints return maker.constraints
} }
internal class func makeConstraints(view: View, block: (make: ConstraintMaker) -> Void) { internal class func makeConstraints(view: View, @noescape block: (make: ConstraintMaker) -> Void) {
#if os(iOS) #if os(iOS)
view.setTranslatesAutoresizingMaskIntoConstraints(false) view.setTranslatesAutoresizingMaskIntoConstraints(false)
#else #else
@ -80,7 +80,7 @@ public class ConstraintMaker {
} }
} }
internal class func remakeConstraints(view: View, block: (make: ConstraintMaker) -> Void) { internal class func remakeConstraints(view: View, @noescape block: (make: ConstraintMaker) -> Void) {
#if os(iOS) #if os(iOS)
view.setTranslatesAutoresizingMaskIntoConstraints(false) view.setTranslatesAutoresizingMaskIntoConstraints(false)
#else #else
@ -99,7 +99,7 @@ public class ConstraintMaker {
} }
} }
internal class func updateConstraints(view: View, block: (make: ConstraintMaker) -> Void) { internal class func updateConstraints(view: View, @noescape block: (make: ConstraintMaker) -> Void) {
#if os(iOS) #if os(iOS)
view.setTranslatesAutoresizingMaskIntoConstraints(false) view.setTranslatesAutoresizingMaskIntoConstraints(false)
#else #else

View File

@ -68,19 +68,19 @@ public extension View {
public var snp_centerWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterWithinMargins) } public var snp_centerWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterWithinMargins) }
#endif #endif
public func snp_prepareConstraints(block: (make: ConstraintMaker) -> Void) -> Array<Constraint> { public func snp_prepareConstraints(@noescape block: (make: ConstraintMaker) -> Void) -> Array<Constraint> {
return ConstraintMaker.prepareConstraints(self, block: block) return ConstraintMaker.prepareConstraints(self, block: block)
} }
public func snp_makeConstraints(block: (make: ConstraintMaker) -> Void) { public func snp_makeConstraints(@noescape block: (make: ConstraintMaker) -> Void) {
ConstraintMaker.makeConstraints(self, block: block) ConstraintMaker.makeConstraints(self, block: block)
} }
public func snp_updateConstraints(block: (make: ConstraintMaker) -> Void) { public func snp_updateConstraints(@noescape block: (make: ConstraintMaker) -> Void) {
ConstraintMaker.updateConstraints(self, block: block) ConstraintMaker.updateConstraints(self, block: block)
} }
public func snp_remakeConstraints(block: (make: ConstraintMaker) -> Void) { public func snp_remakeConstraints(@noescape block: (make: ConstraintMaker) -> Void) {
ConstraintMaker.remakeConstraints(self, block: block) ConstraintMaker.remakeConstraints(self, block: block)
} }