<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Tony and Somu,</div><div class=""><br class=""></div><div class="">I have an open radar for this one which has been outstanding for a few months.</div><div class=""><br class=""></div><div class="">Radar #32191242</div><div class=""><br class=""></div><div class="">Hope this helps.</div><div class=""><br class=""></div><div class="">- Rod</div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 15 Jun 2017, at 10:27 am, Tony Parker via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Somu,<div class=""><br class=""></div><div class="">You can certainly file a bug for us. It may be something we are already tracking or already fixed, but the bug report will let us double check that.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">- Tony<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jun 13, 2017, at 12:33 PM, somu subscribe via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Thanks a lot Jordan for pointing out the root cause.</div><div class=""><br class=""></div><div class="">The underlying <font face="Menlo" color="#0433ff" class="">executing</font> and <font face="Menlo" color="#0433ff" class="">finished</font> properties are <font color="#0433ff" face="Menlo" class="">readonly</font> properties.</div><div class=""><br class=""></div><div class="">For an Asynchronous operation I had to <font face="Menlo" color="#0433ff" class="">override</font> it tell when the asynchronous operation completes.&nbsp;</div><div class=""><br class=""></div><div class="">Since they are readonly properties I am unable to call the <font face="Menlo" color="#0433ff" class="">super</font> on them to set values.</div><div class=""><br class=""></div><div class="">I can still use <font face="Menlo" color="#0433ff" class="">String</font>, was just wondering if there was a way to do it using <font color="#0433ff" face="Menlo" class="">KeyPath</font>. It is more out of enthusiasm to try out the <font color="#0433ff" face="Menlo" class="">KeyPath</font> feature in the project :)&nbsp;</div><div class=""><br class=""></div><div class="">Would it be appropriate to file a bug report for the implementation of <font face="Menlo" color="#0433ff" class="">Operation</font>&nbsp;?</div><div class=""><br class=""></div><div class="">Thanks and regards,</div><div class="">Muthu</div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 14 Jun 2017, at 1:32 AM, Jordan Rose &lt;<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi, Muthu. This is a longstanding issue with Operation—the Objective-C name of the property is just "executing", but the KVO keys that the implementors used is "isExecuting". Swift isn't set up to deal with this difference.</div><div class=""><br class=""></div><div class="">Fortunately, the base implementation of Operation already knows how to send the KVO notifications, so you shouldn't have to override these properties at all. If you still want to for some other reason, you can call super instead of storing to a private property.</div><div class=""><br class=""></div><div class="">Hope that helps,</div><div class="">Jordan</div><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jun 13, 2017, at 06:40, somu subscribe via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I am having trouble using <font face="Menlo" color="#0433ff" class="">KeyPath</font> to <font color="#0433ff" face="Menlo" class="">KVC</font> (Key Value Code) in <font color="#0433ff" face="Menlo" class="">Swift 4</font>.</div><div class=""><br class=""></div><div class="">I have a subclass of <font color="#0433ff" face="Menlo" class="">Operation</font> and I am overriding the <font color="#0433ff" face="Menlo" class="">isFinished</font> and <font color="#0433ff" face="Menlo" class="">isExecuting</font> property.</div><div class=""><br class=""></div><div class=""><b class="">Problem:</b></div><div class="">- When I use&nbsp;<span style="color: rgb(4, 51, 255); font-family: Menlo;" class="">KeyPath</span>, the&nbsp;<span style="color: rgb(4, 51, 255); font-family: Menlo;" class="">completionBlock</span>&nbsp;of the operation is not invoked.</div><div class="">- However when I use <font face="Menlo" color="#0433ff" class="">String</font> instead of&nbsp;<span style="color: rgb(4, 51, 255); font-family: Menlo;" class="">KeyPath</span>, the&nbsp;<font color="#0433ff" face="Menlo" class="">completionBlock</font>&nbsp;is invoked.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255);" class=""><b class="">Questions:</b></div><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255);" class="">- Am I missing something ?&nbsp;</div><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255);" class="">- Is there a way to fix it using KeyPath ?</div></div><div class=""><br class=""></div><div class=""><b class="">Code:</b></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp;&nbsp;<span style="color: #ba2da2" class="">override</span> <span style="color: #ba2da2" class="">var</span> isExecuting : <span style="color: #703daa" class="">Bool</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 13px;" class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ba2da2" class="">get</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255);" class=""><span style="" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #ba2da2" class="">return</span><span style="" class=""> </span><span style="color: #4f8187" class="">_executing</span><span style="" class=""> </span>//property in the class</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 13px;" class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ba2da2" class="">set</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3e1e81" class="">willChangeValue</span>(for: \.isExecuting)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #4f8187" class="">_executing</span> = newValue</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3e1e81" class="">didChangeValue</span>(for: \.isExecuting)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 13px;" class="">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; <span style="color: #ba2da2" class="">override</span> <span style="color: #ba2da2" class="">var</span> isFinished : <span style="color: #703daa" class="">Bool</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 13px;" class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ba2da2" class="">get</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255);" class=""><span style="" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #ba2da2" class="">return</span><span style="" class=""> </span><span style="color: #4f8187" class="">_finished</span><span style="" class=""> </span>//property in the class</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255); min-height: 13px;" class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ba2da2" class="">set</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3e1e81" class="">willChangeValue</span>(for: \.isFinished)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #4f8187" class="">_finished</span> = newValue</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #3e1e81" class="">didChangeValue</span>(for: \.isFinished)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; }</div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255);" class=""><div style="font-size: 12px;" class=""><b class="">Configuration:</b></div><div style="font-size: 12px;" class="">- Xcode&nbsp;-&nbsp;9.0 beta (9M136h)&nbsp;</div><div style="font-size: 12px;" class="">- Tested on Simulator (iOS 11)</div><div style="font-size: 12px;" class="">- macOS Sierra&nbsp;-&nbsp;10.12.5 (16F73)</div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Thanks and Regards,</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Muthu</span></div></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>