Factory method with block

suggest change
internal func Init<Type>(value : Type, block: @noescape (object: Type) -> Void) -> Type
{
    block(object: value)
    return value
}

Usage:

Init(UILabel(frame: CGRect.zero)) {
    $0.backgroundColor = UIColor.blackColor()
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents