<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">I'm not sure why you're using 'override' in an extension. Did you mean to put that in a subclass? It seems to work for me there.</div><div class=""><br class=""></div><div class="">Yes, Swift will not let you replace existing methods/properties using an extension if it can statically see that the method/property already exists. (It's not even safe to do that in Objective-C, but the language doesn't stop you.)</div><div class=""><br class=""></div><div class="">Jordan</div><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 1, 2017, at 22:46, Rod Brown via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> 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="">Looks like this is a duplicate of this issue:</div><div class=""><br class=""></div><div class=""><a href="https://bugs.swift.org/browse/SR-1486" class="">https://bugs.swift.org/browse/SR-1486</a></div><div class=""><br class=""></div><div class="">I’m curious if anyone knows whether that is actually a bug, or a behavioural choice on Swift’s part?</div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 2 Aug 2017, at 10:31 am, Rod Brown via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> 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="">Hi everyone,<div class=""><br class=""></div><div class="">Something I’ve come across in iOS 11 is that you can’t override properties that are only available on iOS 11 when deploying with a deployment target less than the current target.</div><div class=""><br class=""></div><div class="">For example the following code is invalid:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; color: rgb(112, 61, 170); background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(186, 45, 162);" class="">extension</span><span style="" class=""> </span>UIViewController<span style="" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255); min-height: 13px;" class=""> <br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255);" class=""> <span style="color: rgb(186, 45, 162);" class="">@available</span>(<span style="color: rgb(186, 45, 162);" class="">iOS</span>, introduced: <span style="color: rgb(39, 42, 216);" class="">11.0</span>)</div><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255);" class=""> <span style="color: rgb(186, 45, 162);" class="">open</span> <span style="color: rgb(186, 45, 162);" class="">override</span> <span style="color: rgb(186, 45, 162);" class="">var</span> <span style="text-decoration: underline;" class="">a</span>dditionalSafeAreaInsets: <span style="color: rgb(112, 61, 170);" class="">UIEdgeInsets</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255);" class=""> <span style="color: rgb(186, 45, 162);" class="">didSet</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255);" class=""><span style="" class=""> </span>// Do work here only relevant to iOS 11</div><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255);" class=""> }</div><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255);" class=""> } </div><div style="margin: 0px; font-size: 11px; line-height: normal; background-color: rgb(255, 255, 255);" class="">}</div></div><div class=""><br class=""></div><div class="">This would be easily overridden in Obj-C, but I can’t do it in Swift. Is there any reason why this limitation exists?</div></div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">Rod</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>_______________________________________________<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>