<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="">I misunderstood the release notes for Xcode 8 beta 6 I read a few days ago. Here what will interest you:<div class=""><br class=""></div><div class="">
                
        
        
                <div class="page" title="Page 9">
                        <div class="section" style="background-color: rgb(100.000000%, 100.000000%, 100.000000%)">
                                <div class="layoutArea">
                                        <div class="column">
                                                <ul class="">
                                                        <li style="font-size: 11.000000pt; font-family: 'MyriadSetPro'; vertical-align: -1.000000pt" class=""><p class=""><span style="font-size: 11pt;" class="">Since ‘id’ now imports as ‘Any’ rather than ‘AnyObject’, you may see errors where you were previously
performing dynamic lookup on ‘AnyObject’. For example in:
</span></p>
                                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">      guard let fileEnumerator = FileManager.default.enumerator(atPath: path)
      else {
</span></pre><p class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">return
}
</span></p>
                                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">      for fileName in fileEnumerator {
          if fileName.hasSuffix(".txt") {
</span></pre>
                                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">              // error: value of type ‘Element’ (aka ‘Any’) has no member
      hasSuffix
</span></pre>
                                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">              print(fileName)
          }
</span></pre><p class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">}<br class="">
</span><span style="font-size: 11pt;" class="">The fix is to either cast to </span><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">AnyObject </span><span style="font-size: 11pt;" class="">explicitly before doing the dynamic lookup, or force cast to a
</span></p><p class=""><span style="font-size: 11pt;" class="">specific object type:
</span></p>
                                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">      guard let fileEnumerator = FileManager.default.enumerator(atPath: path)
      else {
</span></pre><p class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">return
}
</span></p>
                                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">      for fileName in fileEnumerator {
          if (fileName as AnyObject).hasSuffix(".txt") {
</span></pre>
                                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">              // cast to AnyObject
</span></pre>
                                                                <pre class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">              print(fileName)
          }
</span></pre><p class=""><span style="font-size: 10.000000pt; font-family: 'Menlo'; color: rgb(39.962600%, 39.963610%, 39.963070%)" class="">}
</span></p><p class=""><span style="font-size: 11pt;" class="">(27639935)&nbsp;</span></p>
                                                        </li>
                                                </ul>
                                        </div>
                                </div>
                        </div>
                </div></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 25 Aug 2016, at 10:32, Quinn The Eskimo! 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=""><div class=""><br class="">On 25 Aug 2016, at 09:27, David Hart &lt;<a href="mailto:david@hartbit.com" class="">david@hartbit.com</a>&gt; wrote:<br class=""><br class=""><blockquote type="cite" class="">That proposal also says:<br class=""></blockquote><br class="">Indeed. &nbsp;Good point.<br class=""><br class=""><blockquote type="cite" class="">What was decided concerning that?<br class=""></blockquote><br class="">I don’t know, although given that that text was from the “Future Directions” section it seems like that nothing has changed yet.<br class=""><br class="">Share and Enjoy<br class="">--<br class="">Quinn "The Eskimo!" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="http://www.apple.com/developer/" class="">http://www.apple.com/developer/</a>&gt;<br class="">Apple Developer Relations, Developer Technical Support, Core OS/Hardware<br class=""><br class=""><br class="">_______________________________________________<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></div></blockquote></div><br class=""></div></body></html>