<div dir="ltr"><div class="gmail_default" style="font-family:comic sans ms,sans-serif;color:#274e13">+1</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 1, 2016 at 8:47 AM, Ayaka Nonaka via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">That’s so great to hear. Thank you! :)</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 30, 2016 at 4:36 PM, Harlan Haskins <span dir="ltr"><<a href="mailto:harlan@harlanhaskins.com" target="_blank">harlan@harlanhaskins.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">+1. Robert and I are toying with an implementation right now; it’s really straightforward.<span><font color="#888888"><div><br></div><div>— Harlan</div></font></span><div><br><div><blockquote type="cite"><div><div><div>On Jun 30, 2016, at 3:16 PM, Ayaka Nonaka via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br></div></div><div><div><div><div dir="ltr">Hi Swift community,<blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><br></div></blockquote><div>I was wondering if bridging Objective-C’s <font face="monospace, monospace">@compatibility_alias</font> to Swift’s <font face="monospace, monospace">typealias</font><font face="arial, helvetica, sans-serif"> is something that we have considered adding support for.</font></div><div><br></div><div><font face="arial, helvetica, sans-serif">For example, </font><span style="font-family:monospace,monospace">@compatibility_alias </span><font face="arial, helvetica, sans-serif">is useful for things like adding an alias like </font><font face="monospace, monospace">DCColor</font><font face="arial, helvetica, sans-serif"> for </font><font face="monospace, monospace">UIColor</font><font face="arial, helvetica, sans-serif"> and </font><font face="monospace, monospace">NSColor</font><font face="arial, helvetica, sans-serif"> depending on the target. Here’s an example from our codebase:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><font face="monospace, monospace">// For color compatibility, we alias DCColor to the appropriate class<br>#if DC_TARGET_MOBILE<br>#import <UIKit/UIKit.h><br>@compatibility_alias DCColor UIColor;<br>#else<br>#import <Cocoa/Cocoa.h><br>@compatibility_alias DCColor NSColor;<br>#endif</font><div><font face="monospace, monospace"><br></font></div><div>We expected <font face="monospace, monospace">DCColor</font> to be exposed to our Swift code, but it turns out that it is not. I’d imagine that we’re not the only ones using <span style="font-family:monospace,monospace">@compatibility_alias</span><font face="arial, helvetica, sans-serif"> for similar things and other things that are useful. It would be really cool to see seamless bridging between </font><font face="monospace, monospace">@compatibility_alias</font> and <font face="monospace, monospace">typealias</font>, especially since we’ve seen a lot of other great backwards compatibility features in Swift 3.0 like importing lightweight-generics and <font face="monospace, monospace">#keyPath</font>.</div><div><br></div><div>Thanks for reading! :D</div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Ayaka</font></div><div><font face="arial, helvetica, sans-serif"><br></font><div><div>-- </div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Ayaka Nonaka<div><div><a href="https://twitter.com/ayanonagon" target="_blank">@ayanonagon</a> | <a href="http://www.ayaka.me/" target="_blank">www.ayaka.me</a></div></div></div></div></div></div>
</div></div></div></div></div><span>
_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></span></div></blockquote></div><br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Ayaka Nonaka<div><div><a href="https://twitter.com/ayanonagon" target="_blank">@ayanonagon</a> | <a href="http://www.ayaka.me" target="_blank">www.ayaka.me</a></div></div></div></div></div></div>
</div>
</div></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>