<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=""><div class="">Aliases would be one step towards my vision, but long term I'd like to see a class like "UIViewController" to be imported as "ViewController".</div><br class=""><div><blockquote type="cite" class=""><div class="">On 30 Mar 2017, at 23:17, Adrian Zubarev <<a href="mailto:adrian.zubarev@devandartist.com" class="">adrian.zubarev@devandartist.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">Typo: I actually meant<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;" class="">type-</code><span class="Apple-converted-space"> </span>and<span class="Apple-converted-space"> </span><code style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(234, 234, 234); margin: 0px 2px; padding: 0px 5px; word-break: normal; word-wrap: normal;" class="">module-alias</code>.</p><div style="margin: 15px 0px;" class=""><br class="webkit-block-placeholder"></div></div><div class="bloop_original_html" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><br class=""></div><br class=""><div id="bloop_sign_1490908612753395200" class="bloop_sign"><div style="font-family: helvetica, arial; font-size: 13px;" class="">-- <br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><br class=""><p class="airmail_on" style="margin: 15px 0px;">Am 30. März 2017 um 23:16:14, Adrian Zubarev (<a href="mailto:adrian.zubarev@devandartist.com" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">adrian.zubarev@devandartist.com</a>) schrieb:</p><blockquote type="cite" class="clean_bq" style="margin: 15px 0px;"><span style="margin-top: 0px; margin-bottom: 0px;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""></div><div class=""><div class="bloop_markdown"><p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">Something like a type- and type-alias when importing from Obj-C to Swift?</p><p style="margin: 15px 0px;" class="">That would be reasonable, I’d guess.</p></div><div class="bloop_original_html"><div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><br class=""></div><br class=""><div id="bloop_sign_1490908424425459968" class="bloop_sign"><div style="font-family: helvetica, arial; font-size: 13px;" class="">-- <br class="">Adrian Zubarev<br class="">Sent with Airmail</div></div><br class=""><p class="airmail_on" style="margin: 15px 0px;">Am 30. März 2017 um 23:12:30, Louis D'hauwe (<a href="mailto:louisdhauwe@silverfox.be" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;" class="">louisdhauwe@silverfox.be</a>) schrieb:</p><blockquote type="cite" class="clean_bq" style="margin: 15px 0px;"><div class="" style="margin-top: 0px; margin-bottom: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><span class="">I disagree, my proposal is not to rename Apple frameworks. </span><div class=""><span class="">It is to improve the importing of Objective-C designed frameworks to remove the unnecessary prefixes.</span></div><div class=""><span class=""><br class=""></span></div><div class=""><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="">– Louis D'hauwe</span></div><div class=""><span class=""><br class=""></span><div class=""><blockquote type="cite" class="" style="margin: 15px 0px;"><div class="" style="margin-top: 0px;"><span class="">On 30 Mar 2017, at 23:07, Adrian Zubarev <<a href="mailto:adrian.zubarev@devandartist.com" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">adrian.zubarev@devandartist.com</a>> wrote:</span></div><span class=""><br class="Apple-interchange-newline"></span><div class="" style="margin-bottom: 0px;"><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><p class="" style="margin: 15px 0px; -webkit-margin-before: 0px;"><span style="-webkit-margin-before: 0px;" class="">The issue is, this has nothing to do with swift evolution. You could file a bug report for the Apple frameworks, but I doubt something this huge will make it through.</span></p><div class="" style="margin: 15px 0px;"><span style="-webkit-margin-before: 0px;" class=""><br class="webkit-block-placeholder" style="-webkit-margin-before: 0px;"></span></div></div><div class="bloop_original_html" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><div id="bloop_customfont" class="" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;"><span class=""><br class=""></span></div><span class=""><br class=""></span><div id="bloop_sign_1490907906995757056" class="bloop_sign"><div class="" style="font-family: helvetica, arial; font-size: 13px;"><span class="">-- <br class="">Adrian Zubarev<br class="">Sent with Airmail</span></div></div><span class=""><br class=""></span><p class="airmail_on" style="margin: 15px 0px;"><span class="">Am 30. März 2017 um 23:03:52, Louis D'hauwe via swift-evolution (<a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">swift-evolution@swift.org</a>) schrieb:</span></p><blockquote type="cite" class="clean_bq" style="margin: 15px 0px;"><div class="" style="margin-top: 0px; margin-bottom: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""></div><div class=""><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class=""><span class="" style="margin-top: 0px; margin-bottom: 0px;">Apple frameworks contain prefixes, carried over from Objective-C.</span></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">These exist to prevent class and method name collisions.</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">Mattt Thompson has a great article about this, containing the following brilliant excerpt:</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">"Namespacing is the preeminent bugbear of Objective-C. A cosmetic quirk with global implications, the language’s lack of identifier containers remains a source of prodigious quantities of caremad for armchair language critics." (<a href="http://nshipster.com/namespacing/" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">http://nshipster.com/namespacing/</a>)</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">Since Swift can handle with these naming conflicts, wouldn't it make sense to drop all framework prefixes in a Swift environment?</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">A classic example is UIKit, where all classes are prefixed with "UI". </span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">Code example:</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> import UIKit</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> class FooViewController: UIViewController {</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class="webkit-block-placeholder"></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> }</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">Dropping the prefix would simply lead to the following:</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> import UIKit</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> class FooViewController: ViewController {</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class="webkit-block-placeholder"></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> }</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">Since conflicts need to be handled by specifying the module name, the following could be used if "ViewController" was also used by either some, other than UIKit, imported framework or by a user defined class:</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> import UIKit</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> class FooViewController: UIKit.ViewController {</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class="webkit-block-placeholder"></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> }</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">"UIKit.ViewController" is of course quite longer than the current "UIViewController".</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">An improvement could be to allow frameworks to specify an abbreviated form.</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">UIKit could define "UI" as its abbreviation, making the following code valid:</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> import UI</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> class FooViewController: UI.ViewController {</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class="webkit-block-placeholder"></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"> }</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">This all seems to me like a natural continuation of <a href="https://github.com/apple/swift-evolution/blob/9cf2685293108ea3efcbebb7ee6a8618b83d4a90/proposals/0086-drop-foundation-ns.md" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">SE-0086</a>.</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">I do realise this would be a major change, breaking pretty much every Swift iOS, macOS, tvOS and watchOS project.</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">But in the long term, I think it's worth it.</span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69); min-height: 14px;"><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal; font-family: 'Helvetica Neue'; color: rgb(69, 69, 69);"><span class="" style="margin-top: 0px; margin-bottom: 0px;">– Louis D'hauwe</span></div><div class=""><span class="" style="margin-top: 0px; margin-bottom: 0px;"><br class=""></span></div><span class="" style="margin-top: 0px; margin-bottom: 0px;">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="" style="color: rgb(65, 131, 196); background-color: inherit; text-decoration: none;">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></span></div></div></blockquote></div><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><div class="bloop_markdown"></div></div></div></span></blockquote></div><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><br class="Apple-interchange-newline"></div></div></blockquote></div><br class=""></body></html>