<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">Glad to know it. Thank you, Jack.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">Zhaoxin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 26, 2016 at 10:17 AM, Jack Lawrence <span dir="ltr"><<a href="mailto:jackl@apple.com" target="_blank">jackl@apple.com</a>></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">The API Reference SDK availability section in the documentation is incorrect for symbols defined in a Swift overlay. This is a known issue.<div><br></div><div>Unless it has an explicit @available attribute (check the generated interface), any symbol defined in a Swift overlay is available for all platform versions where swift 3 is compatible (iOS 7, macOS 10.9, etc).</div><div><div><br></div><div>Jack<br><div><blockquote type="cite"><div><div class="h5"><div>On Sep 25, 2016, at 6:01 PM, Zhao Xin via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">In the <a href="https://swift.org/migration-guide/" target="_blank">official migrating guide</a>.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default"><p style="font-family:'helvetica neue',helvetica,arial,verdana,sans-serif;margin:0px 0px 1.5em;padding:0px;color:rgb(51,51,51);font-size:18px">You can choose from two kinds of migration to perform:</p><ul style="font-family:'helvetica neue',helvetica,arial,verdana,sans-serif;margin:1em 0px;padding:0px 0px 0px 40px;list-style-position:initial;color:rgb(51,51,51);font-size:18px"><li style="margin:0px;padding:0px"><strong>Use Swift 2.3</strong> Modifies your project to enable the <em>Use Legacy Swift</em> build setting and provides source changes to be able to build against the new SDKs.</li><li style="margin:0px;padding:0px"><strong>Use Swift 3</strong> This is recommended. You will get source changes to be able to build your project using Swift 3 and take advantage of all the new features in Xcode 8.0.</li></ul><p style="font-family:'helvetica neue',helvetica,arial,verdana,sans-serif;margin:0px 0px 1.5em;padding:0px;color:rgb(51,51,51);font-size:18px">Optionally, you can move to Swift 2.3 now and invoke the migration assistant again later to update to Swift 3.</p><p style="margin:0px 0px 1.5em;padding:0px"><font face="georgia, serif">So it seems to me that Swift 3 will only works with the new SDKs (iOS 10, macOS 10.12, watchOS 3, tvOS 10). The API explanation enhanced my theory.</font></p><p style="margin:0px 0px 1.5em;padding:0px"><font face="georgia, serif"><a href="https://developer.apple.com/reference/foundation/data/1780388-init" target="_blank">Data.init(base64Encoded:<wbr>options:)</a></font></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Language<br>Swift<br>SDKs<br>iOS 10.0+<br>macOS 10.12+<br>tvOS 10.0+<br>watchOS 3.0+</blockquote><div> </div><div><font face="georgia, serif">I created a new Cocoa application project in Xcode 8. Since my OS is macOS 10.11, the `Deployment Target` is `10.11`, the `Base SDK` is `10.12`. Since the newly created project's swift version is default 3.0. I thought I couldn't use any apis that were marked as `macOS 10.12+`. However, I was wrong. Below code worked.</font></div><div><font face="georgia, serif"><br></font></div><div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="color:rgb(187,44,162)">var</span><span> data = </span><span style="color:rgb(112,61,170)">Data</span><span>(base64Encoded: </span><span style="color:rgb(209,47,27)">"Hello World!"</span><span>)</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo"><span style="color:rgb(61,29,129)">print</span><span>(data) </span><span style="color:rgb(0,132,0)">// prints nil</span></div></div><div><font face="georgia, serif"><br></font></div><div><font face="georgia, serif">So what are the boundary between old APIs with new APIs between OS versions? Is the API doc wrong? In previous docs, if an API is marked as available only in the latest OS, you can't use it in old OS. Is that rule changed in Swift 3?</font></div><div><font face="georgia, serif"><br></font></div><div><font face="georgia, serif">Zhaoxin</font></div><div><font face="georgia, serif"><br></font></div><div><font face="georgia, serif"><br></font></div></div></div></div></div>
______________________________<wbr>_________________<br>swift-users mailing list<br><a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br></div></blockquote></div><br></div></div></div></blockquote></div><br></div>