Jul 31, 2017

KVO

Notify objects when changes to properties of other objects. Very similar to willSet and didSet, but they can be defined outside of the type defination.

observation = observe(
            \.objectToObserve.myDate,
            options: [.old, .new]
        ) { object, change in
            print("myDate changed from: \(change.oldValue!), updated to: \(change.newValue!)")
        }