<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 6, 2016, at 11:04 AM, Jonathan Tang &lt;<a href="mailto:jonathan.d.tang@gmail.com" class="">jonathan.d.tang@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Wed, Apr 6, 2016 at 9:58 AM, Douglas Gregor via swift-evolution<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><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;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Apr 5, 2016, at 4:04 PM, Drew Crawford &lt;<a href="mailto:drew@sealedabstract.com" target="_blank" class="">drew@sealedabstract.com</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap: break-word;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 5, 2016, at 12:06 PM, Douglas Gregor &lt;<a href="mailto:dgregor@apple.com" target="_blank" class="">dgregor@apple.com</a>&gt; wrote:</div><div class=""><div style="font-family: HelveticaNeue; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: HelveticaNeue; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">I would not want this to be implicit behavior: it should be recorded in the source with, e.g.,</div><div style="font-family: HelveticaNeue; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: HelveticaNeue; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="white-space: pre-wrap;" class="">        </span>@availability(iOS: 9.3) import YourCustomFramework</div><div style="font-family: HelveticaNeue; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: HelveticaNeue; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">so that it is clear that the imported declarations are only available on iOS 9.3 or newer.</div><div style="font-family: HelveticaNeue; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><br class=""></div><div style="font-family: HelveticaNeue; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="white-space: pre-wrap;" class="">        </span>- Doug</div></div></blockquote></div><br class=""><div class="">Would you promote using this syntax for the Apple frameworks as well?</div></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word;" class=""><div class="">A major goal for me is syntax consistency between Apple's and third-party frameworks.&nbsp; That way the knowledge of how to use one transfers to the other, and we ensure people with fresh ideas about how to build frameworks are not burdened with educating application developers about "novel" import syntax.</div></div></div></blockquote><div class=""><br class=""></div></span>Apple frameworks tend to have ail their various classes and other APIs annotated with availability attributes, so I wouldn’t expect to need this import syntax for any of those. Really, this syntax is a shorthand for “treat the imported library as if the author had put this availability annotation on all of its public APIs”. If your goal is consistency between Apple frameworks and other frameworks, I don’t think this is the way to go.</div><div class=""><br class=""></div><div class=""><br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">Does this mean that the recommended best practice for framework authors is to set the deployment target low and then add an availability attribute for every public symbol?&nbsp;</div></div></div></blockquote><br class=""></div><div>Every public symbol that needs it, sure. Fortunately, Swift tells you when you get it wrong.</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>- Doug</div><div><br class=""></div><br class=""></body></html>