> On Jul 8, 2016, at 6:45 AM, Adrian Zubarev via swift-evolution
> <[email protected]> wrote:
>
> It’s clear that we should decide on when our observer will be executed. In
> the example from above I pretended that my observer will be executed after
> the observer from the module itself.
>
> When we set a.member2 the observer for member1 on our side will be called
> first, follows by member2 observer, which ‘might’ not be what we need.
>
> I’d suggest that if this ‘feature’ might ever be considered for Swift that we
> should be able to set the execution order.
>
> Bikeshedding:
>
> observe(first) // called before observer from the module are called
> observe(last) // called after the observer from the module where called
I think I’d say that your “local” willset should be called before the module’s,
and your local didset should be called after the module’s. This ensures that
module’s code executes closest to when the memory gets changed.
- Dave Sweeris
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution