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
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to