iOS Initialization idioms Initialize with then

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

This is similar in syntax to the example that initializes using positional constants, but requires the Then extension from https://github.com/devxoul/Then (attached below).

let label = UILabel().then {
    $0.textAlignment = .Center
    $0.textColor = UIColor.blackColor(
    $0.text = "Hello, World!"
}

The Then extension:

import Foundation

public protocol Then {}

extension Then 
{
    public func then(@noescape block: inout Self -> Void) -> Self {
        var copy = self
        block(&copy)
        return copy
    }
}

extension NSObject: Then {}


Got any iOS Question?