Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Sources/Then/Then.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,23 @@ extension Then where Self: AnyObject {

}

extension Then where Self: NSObject {


/// Makes it available to set properties with closures just after initializing.
///
/// let label = UILabel {
/// $0.textAlignment = .Center
/// $0.textColor = UIColor.blackColor()
/// $0.text = "Hello, World!"
/// }
init(block: (Self) -> Void) {
self.init()
block(self)
}

}

extension NSObject: Then {}

extension CGPoint: Then {}
Expand Down