selector(Thing.thingWatched) won't work because it expects a function. As thingWatched is a property, it doesn't know if you want to reference the getter or setter. SE-0064 lets you reference those explicitly. In this case, you could write NSStringFromSelector(selector(getter: Thing.thingWatched)), which is far from elegant. SE-0062 is there to fix that: keypath(Thing.thingWatched) will return the correct string.
···
Sent from my iPhone
On 04 Jun 2016, at 16:18, Rob Napier <robnapier@gmail.com> wrote:
Currently KVO requires hard-coding strings to check the keypath. Does SE-0064 cover returning a string when a string is required? For example:
override func observeValueForKeyPath(keyPath: String?,
ofObject object: AnyObject?,
change: [String : AnyObject]?,
context: UnsafeMutablePointer<Void>) {
if let changingThing = object as? Thing,
keyPath = keyPath where changingThing === thing {