Hello dear Swift community, I’m not sure if this was discussed before or not, 
but I really want to know if something like this is welcome for the future 
Swift version. If this topic was already discussed, I’m apologizing for 
bringing it back to life in a new thread.

Lets say I’ve got a third party module and I want to know when the a variable 
of some type has changed:

extension UIViewController {
     
    public override var view: UIView {
         
        willSet {
            // do something useful here
        }
         
        didSet {
            // do something useful here
        }
    }
}
Wouldn’t be handy to inject custom didSet and willSet functions into any 
property or computed property?

This would also allow us to build a proper two-way-binding mechanism.



-- 
Adrian Zubarev
Sent with Airmail
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to