@noescape on methods

This commit is contained in:
Martin Conte Mac Donell 2015-04-10 21:15:40 -07:00
parent e0a859a578
commit 9cec048c44
2 changed files with 8 additions and 8 deletions

View File

@ -61,13 +61,13 @@ public class ConstraintMaker {
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)
block(make: maker)
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)
view.setTranslatesAutoresizingMaskIntoConstraints(false)
#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)
view.setTranslatesAutoresizingMaskIntoConstraints(false)
#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)
view.setTranslatesAutoresizingMaskIntoConstraints(false)
#else

View File

@ -68,19 +68,19 @@ public extension View {
public var snp_centerWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterWithinMargins) }
#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)
}
public func snp_makeConstraints(block: (make: ConstraintMaker) -> Void) {
public func snp_makeConstraints(@noescape block: (make: ConstraintMaker) -> Void) {
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)
}
public func snp_remakeConstraints(block: (make: ConstraintMaker) -> Void) {
public func snp_remakeConstraints(@noescape block: (make: ConstraintMaker) -> Void) {
ConstraintMaker.remakeConstraints(self, block: block)
}