<div dir="ltr">Currently KVO requires hard-coding strings to check the keypath. Does SE-0064 cover returning a string when a string is required? For example:<div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">override</span><span style=""> </span><span style="color:rgb(187,44,162)">func</span><span style=""> observeValueForKeyPath(keyPath: </span><span style="color:rgb(112,61,170)">String</span><span style="">?, </span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">                                     ofObject object: </span><span style="color:rgb(112,61,170)">AnyObject</span><span style="">?, </span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">                                     change: [</span><span style="color:rgb(112,61,170)">String</span><span style=""> : </span><span style="color:rgb(112,61,170)">AnyObject</span><span style="">]?,</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">                                     context: </span><span style="color:rgb(112,61,170)">UnsafeMutablePointer</span><span style="">&lt;</span><span style="color:rgb(112,61,170)">Void</span><span style="">&gt;) {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">    <span style="color:rgb(187,44,162)">if</span> <span style="color:rgb(187,44,162)">let</span> changingThing = object <span style="color:rgb(187,44,162)">as</span>? <span style="color:rgb(79,129,135)">Thing</span>, <br></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">           keyPath = keyPath </span><span style="color:rgb(187,44,162)">where</span><span style=""> </span>changingThing<span style=""> === </span><span style="color:rgb(79,129,135)">thing</span><span style=""> {</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style=""><br></span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="">        </span><span style="color:rgb(187,44,162)">switch</span><span style=""> keyPath {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span style="color:rgb(0,0,0)">        </span><span style="color:rgb(187,44,162)">case</span><span style="color:rgb(0,0,0)"> </span><span style="">&quot;thingWatched&quot;</span><span style="color:rgb(0,0,0)">: ...</span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span style="color:rgb(0,0,0)"><br></span></p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span style="font-family:arial,sans-serif;font-size:small;color:rgb(34,34,34)">I&#39;d like to replace that last line with:</span><br></p></div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(209,47,27)"><span style="color:rgb(0,0,0)">        </span><span style="color:rgb(187,44,162)">case</span><span style="color:rgb(0,0,0)"> #selector(Thing.thingWatched):</span></p></div><div><br></div><div>Or something similarly non-stringy.</div><div><br></div><div>Alternately, this comes back to your &quot;Referencing Objective-C key-paths&quot; proposal, but I&#39;m wondering if 0064 already covers this case.</div><div><br></div><div>-Rob</div></div>