> On Apr 13, 2016, at 7:50 AM, Benzi via swift-evolution 
> <[email protected]> wrote:
> 
> The closest right now you can achieve would be:
> 
> func with<T>(item:T, apply:(T)->Void) {
>     apply(item)
> }
> 
> 
> let label = UILabel()
> label.highlighted // defaults to false
> 
> with(label) {
>     $0.highlighted = true
> }
> 
> label.highlighted // is now true

As a reference type, you can just go ahead and assign:

let label  = UILabel()
label.highlighted = true

-- E


_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to