<div dir="ltr">Yes, it was pretty much meant as a KVC-like feature for Swift. Get a reference to a property from a string which would allow you to get and set its value.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 27, 2016 at 11:53 AM, Ricardo Parada <span dir="ltr">&lt;<a href="mailto:rparada@mac.com" target="_blank">rparada@mac.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class=""><br><div><blockquote type="cite"><div>On May 26, 2016, at 9:25 PM, Austin Zheng via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div style="font-family:Helvetica;font-size:14px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">```</div><div style="font-family:Helvetica;font-size:14px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">myPerson.typedReadWriteProperty&lt;Int&gt;(&quot;age&quot;)?.set(30)</div><div style="font-family:Helvetica;font-size:14px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:14px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">try myPerson.allNamedProperties[&quot;age&quot;]?.set(30)</div><div style="font-family:Helvetica;font-size:14px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">```</div><br></div></blockquote></div><br></span><div>Can you elaborate on what this API would be used for?  KVC? For instance, I played with Mirror the other day and my code to get a value given the property name looked more like this:</div><div><br></div><div>let age = myPerson.value(forKey:”age”) as! Int</div><div><br></div><div>And this is what I did:</div><div><br></div><div>// KVC stands for key-value-coding… but I only know how to get values.  I don’t know how to set values</div><div><br></div><div><div>protocol KVC {</div><div>   func value(forKey key: String) -&gt; Any!</div><div>}</div><div><br></div><div>// Default implementation</div><div>extension KVC {</div><div>   func value(forKey key: String) -&gt; Any! {</div><div>       let aMirror = Mirror(reflecting:self)</div><div>       for case let (label?, value) in aMirror.children {</div><div>           if label == key {</div><div>               return value</div><div>           }</div><div>       }</div><div>       return nil</div><div>   }</div><div>}</div><div><br></div><div>public struct Person : KVC {</div><div>   let firstName: String</div><div>   let lastName: String</div><div>   let age: Int</div><div><br></div><div>   func fullName() -&gt; String {</div><div>       return &quot;\(firstName) \(lastName)&quot;</div><div>   }</div><div>}</div><div><br></div><div>let aPerson = Person(firstName:&quot;John&quot;, lastName:&quot;Doe&quot;, age:48)</div><div><br></div><div>// It works for stored properties</div><div>let lastName = aPerson.value(forKey:&quot;lastName&quot;) as! String</div><div>print(&quot;Last name is \(lastName)&quot;)</div><div><br></div><div>// It does not work for instance methods, i.e. fullName is not a stored property</div><div>let fullName = aPerson.value(forKey:&quot;fullName&quot;)</div><div>if fullName != nil {</div><div>   print(&quot;Full name is \(fullName)&quot;)</div><div>} else {</div><div>   print(&quot;Unable to get fullName via KVC&quot;)</div><div>}</div></div><div><br></div><div><br></div><div><br></div></div></blockquote></div><br></div>