<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="">String is bridged it just is not yet implicitly converted via the compiler; we are missing certain functionality due to the compiler not supporting the objc code paths on linux.</div><div class=""><br class=""></div><div class="">The re-naming of swift classes exposed from Foundation will likely leave the class NSString still a thing (however it likely will have some special case of naming since there is a conflict between Foundation’s String and Swift’s String that is yet to be determined fully on how that will be done), so it is still a bit up-in-the-air on how that will be achieved. However since there are desired behavioral differences between NSString and String we cannot just wholesale make it an extension since some of the functions that apply to NSString don’t make much sense for String (e.g. characterAtIndex etc).</div><div class=""><br class=""></div><div class="">The bug you are probably looking for is:&nbsp;<a href="https://bugs.swift.org/browse/SR-138" class="">https://bugs.swift.org/browse/SR-138</a>. Basically what we need is&nbsp;_ObjectTypeBridgeable to behave similarly to the type conversion portion of&nbsp;_ObjectiveCBridgeable. This would likely be primarily work in the compiler and also a bit of work in the stdlib for a few of the overlay extensions etc.</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 2, 2016, at 12:24 AM, Drew Crawford via swift-corelibs-dev &lt;<a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I've noticed that e.g. String is not bridged to NSString. &nbsp;The expected workaround seems to be calling .bridge() everywhere.<div class=""><br class=""></div><div class="">1. &nbsp;Is there a plan for bridging e.g. String with NSString?</div><div class="">2. &nbsp;Would it be appropriate to PR in the meantime e.g.</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">extension&nbsp;String&nbsp;{</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;public&nbsp;func&nbsp;cStringUsingEncoding(encoding:&nbsp;UInt) -&gt;&nbsp;UnsafePointer&lt;Int8&gt; {</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;self.bridge().cStringUsingEncoding(encoding)</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;}</div><div class="">&nbsp; &nbsp;&nbsp;}</div></blockquote><br class=""><div class="">&nbsp; 3. &nbsp;The README also says</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><blockquote type="cite" class="">We will also drop the 'NS' prefix from all Foundation classes</blockquote></div></blockquote><div class=""><br class=""></div><div class="">...is <b class="">that</b>&nbsp;the resolution? &nbsp;e.g what is currently <b class="">class NSString</b>&nbsp;will become instead <b class="">extension String</b>? &nbsp;Is there a bug open for that?</div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=0mkChau6XnFV-2FCNUik62L9ZaldD0W0ziOwj-2F3jLx36-2F70NR7qRDcM88NooZrjd2LQmZ7pbgaCofMvKv-2B0VuoTb1xK-2FWxeFGyZ1izs-2BQZI8-2FHFzY6QRvv8hM4Bc50JkDRjxwzqdW61ikdyTnQ8M4e3bHpKsUy0WcHoS1mUV9RcQF-2BfZ2OwhB-2BB2um8iLnuLa5n2pxm8cVxEkSDop0V0nmUVE-2BzX4FFWtaFpK-2FFfUuu-2FA-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
</div>
_______________________________________________<br class="">swift-corelibs-dev mailing list<br class=""><a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev<br class=""></div></blockquote></div><br class=""></body></html>