<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="">Here is an attempt to express myself better :)<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 15px; line-height: normal;" class=""><b class="">Objective-C to Swift category to extension conversion loss of descriptive name</b></div><div style="margin: 0px; font-size: 15px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; min-height: 14px;" class=""><b class="">Objective-C category:</b></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">@interface</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;NSAttributedString (NSAttributedStringDocumentFormats)</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">// Methods initializing the receiver contents with an external document data.&nbsp;&nbsp;options specify document attributes for interpreting the document contents.&nbsp;&nbsp;NSDocumentTypeDocumentAttribute, NSCharacterEncodingDocumentAttribute, and NSDefaultAttributesDocumentAttribute are supported options key.&nbsp;&nbsp;When they are not specified, these methods will examine the data and do their best to detect the appropriate attributes.&nbsp;&nbsp;If dict is non-NULL, it will return a dictionary with various document-wide attributes accessible via NS...DocumentAttribute keys.</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">- (</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">nullable</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">instancetype</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)initWithURL:(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">NSURL</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;*)url options:(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">NSDictionary</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&lt;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">NSString</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;*,&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">id</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&gt; *)options documentAttributes:(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">NSDictionary</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&lt;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">NSString</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;*,&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">id</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&gt; *&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">__nullable</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;*&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">__nullable</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)dict error:(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">NSError</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;**)error&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(120, 73, 42);" class="">NS_AVAILABLE</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">10</span><span style="font-variant-ligatures: no-common-ligatures;" class="">_11,&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">9</span><span style="font-variant-ligatures: no-common-ligatures;" class="">_0);</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class="">...</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">@end</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162); min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><b class="">Translated Swift extension:</b></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">NSAttributedString</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;{</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">// Methods initializing the receiver contents with an external document data.&nbsp;&nbsp;options specify document attributes for interpreting the document contents.&nbsp;&nbsp;NSDocumentTypeDocumentAttribute, NSCharacterEncodingDocumentAttribute, and NSDefaultAttributesDocumentAttribute are supported options key.&nbsp;&nbsp;When they are not specified, these methods will examine the data and do their best to detect the appropriate attributes.&nbsp;&nbsp;If dict is non-NULL, it will return a dictionary with various document-wide attributes accessible via NS...DocumentAttribute keys.</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">@available</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">iOS</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">9.0</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">, *)</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">init</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">(URL url:&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">NSURL</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">, options: [</span><span style="font-variant-ligatures: no-common-ligatures;" class="">String</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;:&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">AnyObject</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">], documentAttributes dict:&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">AutoreleasingUnsafeMutablePointer</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&lt;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">NSDictionary</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">?&gt;)&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">throws</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">...</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">The self-documenting name of the category is lost when imported in Swift. Some categories have no outward comment describing it because they seem to rely on the category name. For example, this one *does* have a comment describing it that is imported into swift:</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><b class="">Objective-C</b></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">/************************ Attribute fixing ************************/</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">@interface</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;NSMutableAttributedString (NSAttributedStringAttributeFixing)</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">@end</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162); min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><b class="">Swift:</b></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">/************************ Attribute fixing ************************/</span></div><div style="margin: 0px; line-height: normal; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">NSMutableAttributedString</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;{</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class="">Again, the comment is not enforced by the compiler and is a <b class="">style</b> choice. Names on categories are enforced (except for a class’s private () category)</div></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162); min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 15px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><b class="">One moonshot: Are extension’s an implementation detail?</b></span></div><div style="margin: 0px; font-size: 16px; line-height: normal; font-family: Menlo; min-height: 19px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Here is the generated interface for a simple View Controller</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;ViewController :&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">UIViewController</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;{</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">override</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;viewDidLoad()</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">override</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;didReceiveMemoryWarning()</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">ViewController</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;{</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;test()</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Theoretically, if we had named extensions:</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures;" class="">ViewController&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">named&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);" class="">Test</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp;{</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;test() {</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;}</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">could be translated to:</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">class</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;ViewController :&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">UIViewController</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;{</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">override</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;viewDidLoad()</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">override</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">internal</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;didReceiveMemoryWarning()</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Test:</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#008400" class="">&nbsp; &nbsp;&nbsp;</font><font color="#bb2ca2" class="">internal</font></span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;</span><span style="color: rgb(187, 44, 162); font-variant-ligatures: no-common-ligatures;" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;test()</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo; min-height: 14px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""></span><br class=""></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">I am not sure if this behavior would be truly desired, but it would allow the methods to remained group under a comment or a header of some sort.</span></div></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">//Phew</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Brandon</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div><blockquote type="cite" class=""><div class="">On May 16, 2016, at 4:25 PM, T.J. Usiyan &lt;<a href="mailto:griotspeak@gmail.com" class="">griotspeak@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I have wanted this feature and floated it a while back. I hope we can get some traction this time but I doubt it will happen soon since additive features are tabled for a time.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, May 16, 2016 at 3:47 PM, Brandon Knope via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">I think requiring them to be in comments is what’s going to prevent their adoption.<div class=""><br class=""></div><div class="">My fundamental stance is that these awesome features that are required in comments will be overlooked by people because:</div><div class="">• You have to remember the specific syntax&nbsp;</div><div class="">• There is no code completion which means you have to know the *exact* syntax and spelling</div><div class=""><br class=""></div><div class="">At the end of the day, Swift is a new language, and because of this, is there a new and better way to convey information than just sticking everything in a comment?</div><div class=""><br class=""></div><div class="">With autocomplete we could get something like this:</div><div class=""><br class=""></div><div class=""><div style="margin:0px;line-height:normal" class=""><span class=""><font color="#bb2ca2" style="font-family:Menlo;font-size:12px" class="">extension </font><font color="#008cb4" class=""><font face="Menlo" class=""><span style="font-size:12px" class=""><b class="">Type,</b> named <b class="">Name</b> </span></font></font><font face="Menlo" class=""><span style="font-size:12px" class="">{</span></font></span></div></div><div style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo" class=""><span class="">}</span></div><div style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo" class=""><span class=""><br class=""></span></div><div style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo" class=""><span class="">This would make it much easier for people to adopt than requiring them to remember a comment syntax.</span></div><div style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo" class=""><span class=""><br class=""></span></div><div style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo" class=""><span class="">However, if there is no interest, I will not proceed with a proposal.</span></div><div style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo" class=""><span class=""><br class=""></span></div><div style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo" class=""><span class="">Just my .02</span></div><div style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo" class=""><span class="">Brandon</span></div><div style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo" class=""><span class=""><font color="#008cb4" class=""><br class=""></font></span></div><div class="">Where autocomplete would let you tab between naming the Type and Name</div><div class=""><div class="h5"><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 16, 2016, at 3:24 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" target="_blank" class="">erica@ericasadun.com</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" class=""><div class="">Most of the Swift docs markup tech is both very new and still evolving. I'm trying to evangelize the technology, and there are now five markup items that actually tie into the code completion engine:</div><div class=""><br class=""></div><div class=""><ul style="padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class=""><li class=""><p style="margin-top:16px;margin-bottom:16px" class="">Three new doc comment fields, namely&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">- keyword:</code>,&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">- recommended:</code>&nbsp;and&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">- recommendedover:</code>, allow Swift users to cooperate with code completion engine to deliver more effective code completion results. The&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">- keyword:</code>&nbsp;field specifies concepts that are not fully manifested in declaration names.&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">- recommended:</code>&nbsp;indicates other declarations are preferred to the one decorated; to the contrary,&nbsp;<code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:14px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px" class="">- recommendedover:</code>&nbsp;indicates the decorated declaration is preferred to those declarations whose names are specified.</p></li></ul><div class="">-- E</div></div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 16, 2016, at 1:14 PM, Brandon Knope &lt;<a href="mailto:bknope@me.com" target="_blank" class="">bknope@me.com</a>&gt; wrote:</div><br class=""><div class=""><div class="">I have never seen anyone use this. Why? Because it is relatively unknown and not very “pretty” in my opinion. In the ideal world, everyone would have perfectly formatted and up to date comment, but I am not convinced this is usually the case.<br class=""><br class="">It’s good for IDE documenting, but:<br class="">• Online tutorials do NOT use this in code samples, keeping it from being widely known (and because it looks ugly next to their sample and makes it look more verbose)<br class="">• It really does not look nice with the language. It seems like IDE magic<br class="">• What about people writing in a text editor or not in Xcode? If they do not get a benefit out of // MARK: or /// - Keyword: why would they use it?<br class=""><br class="">And a quick read of Matthew’s proposal tells me that it may be beneficial to be able to refer to the name of an extension in the future. I am still reading through his proposal but that’s what I took from it with a quick look.<br class=""><br class=""><br class="">Brandon<br class=""><br class=""><blockquote type="cite" class="">On May 16, 2016, at 3:08 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" target="_blank" class="">erica@ericasadun.com</a>&gt; wrote:<br class=""><br class="">Or better yet, the 'Keyword" token offers searchable content that can relate one extension to the other.<br class=""><br class="">/// - Keyword: Lifecycle extension<br class=""><br class="">-- Erica<br class=""><br class=""><br class=""><blockquote type="cite" class="">On May 16, 2016, at 11:33 AM, Michael Peternell via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class="">Why not just use a (documentation) comment?<br class=""><br class="">/// The Lifecycle extension:<br class="">extension ViewController {<br class="">...<br class=""><br class="">-Michael<br class=""><br class=""><blockquote type="cite" class="">Am 16.05.2016 um 18:26 schrieb Brandon Knope via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;:<br class=""><br class="">I like to separate methods into their own logical extensions so similar methods are grouped together. I do this mostly with Cocoa Touch where I like all view life cycle methods to be in the same extension:<br class=""><br class="">extension ViewController {<br class=""> &nbsp;override func viewDidLoad() {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewWillAppear(animated: Bool) {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewDidDisappear(animated: Bool) {<br class=""> &nbsp;}<br class="">}<br class=""><br class="">You can document this somewhat by adding a MARK comment:<br class=""><br class="">// MARK: Lifecylce<br class="">extension ViewController {<br class=""> &nbsp;override func viewDidLoad() {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewWillAppear(animated: Bool) {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewDidDisappear(animated: Bool) {<br class=""> &nbsp;}<br class="">}<br class=""><br class="">What if we made this more self-documenting by elevating this to a language feature?<br class=""><br class="">extension ViewController named Lifecycle {<br class=""> &nbsp;override func viewDidLoad() {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewWillAppear(animated: Bool) {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewDidDisappear(animated: Bool) {<br class=""> &nbsp;}<br class="">}<br class=""><br class="">Other ways:<br class="">extension named Lifecycle ViewController { }<br class="">extension named “View Lifecycle" ViewController { }<br class="">extension ViewController named “Multi word description” { }<br class=""><br class=""><br class="">For now, this is purely a documenting feature (i.e. Can’t refer to the extension name dynamically or statically in actual code). I think it plays much more naturally with Swift than requiring this to be in the comments and would work across all IDEs and make it easier for people to find a specific extension as well as making their code more self documenting.<br class=""><br class="">Any thoughts?<br class=""><br class="">Thanks,<br class="">Brandon<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></blockquote><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></blockquote><br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></div></div><br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>