<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="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal; widows: 1;">Hello, I heard this is the place to talk about things we’d like to see in Swift.</div><div class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal; widows: 1;"><br class=""></div><div class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal; widows: 1;">There are a few improvements I’d like to see with Objective-C bridging. I find myself repeating the same three code patterns in order to have the best of both Objective-C and Swift worlds.</div><div class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal; widows: 1;"><br class=""></div><div class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal; widows: 1;">First, <b class="">optional primitive types should map to optional NSNumber</b>. Currently, they only map to NSNumber when used in an array or dictionary. The implicitly generated code would look like the following:</div><div class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal; widows: 1;"></div></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">var</span> optIntProperty: <span class="" style="color: rgb(112, 61, 170);">Int</span>?</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">@objc</span>(optIntProperty)</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">var</span> objc_optIntProperty: <span class="" style="color: rgb(112, 61, 170);">NSNumber</span>? {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">get</span> {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">guard</span> <span class="" style="color: rgb(187, 44, 162);">let</span> value = <span class="" style="color: rgb(187, 44, 162);">self</span>.<span class="" style="color: rgb(79, 129, 135);">optIntProperty</span> <span class="" style="color: rgb(187, 44, 162);">else</span> {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">return</span> <span class="" style="color: rgb(187, 44, 162);">nil</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">return</span> <span class="" style="color: rgb(112, 61, 170);">NSNumber</span>(integer: value)</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">set</span> {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">guard</span> <span class="" style="color: rgb(187, 44, 162);">let</span> value = newValue <span class="" style="color: rgb(187, 44, 162);">else</span> {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">self</span>.<span class="" style="color: rgb(79, 129, 135);">optIntProperty</span> = <span class="" style="color: rgb(187, 44, 162);">nil</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">return</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">self</span>.<span class="" style="color: rgb(79, 129, 135);">optIntProperty</span> = value.<span class="" style="color: rgb(112, 61, 170);">integerValue</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; widows: 1;">In the code above, you cannot mark the Int? property dynamic - it causes a compiler error - but it would be nice if you could. This feature would allow shared ObjC classes to be more Swifty, and enable existing runtime reflection/serialization code. I could also see utility of NSNull-nil bridging for values in collections, though this is a rarer case.</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; widows: 1;"><br class=""></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; widows: 1;"><br class=""></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; widows: 1;"> </span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class="">Second, it would be nice for <b class="">C-style structs to bridge to NSValue by default.</b> Currently, every C struct has to implement NSValue bridging manually. I think it’s safe to say that if you mark a struct array property as @objc or dynamic that you typically want it to bridge to NSValue. Additionally, the same optional handling as noted above would be useful.</font></span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class=""><br class=""></font></span></div><blockquote class="" style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);">// pretend this struct were declared in C, or if we get struct exporting in the future (?)</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"><span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">struct</span> MyCStyleStruct {</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">var</span> intProp: <span class="" style="color: rgb(112, 61, 170);">Int</span></div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">var</span> doubleProp: <span class="" style="color: rgb(112, 61, 170);">Float</span></div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;">}</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal; min-height: 13px;"><br class=""></div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal; color: rgb(112, 61, 170);"><span class="" style="color: rgb(187, 44, 162);">extension</span><span class="" style="color: rgb(0, 0, 0);"> </span><span class="" style="color: rgb(79, 129, 135);">MyCStyleStruct</span><span class="" style="color: rgb(0, 0, 0);"> : </span>_ObjectiveCBridgeable<span class="" style="color: rgb(0, 0, 0);"> {</span></div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">typealias</span> _ObjectiveCType = <span class="" style="color: rgb(112, 61, 170);">NSValue</span></div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> _isBridgedToObjectiveC() -> <span class="" style="color: rgb(112, 61, 170);">Bool</span> {</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal; color: rgb(187, 44, 162);"><span class="" style="color: rgb(0, 0, 0);"> </span>return<span class="" style="color: rgb(0, 0, 0);"> </span>true</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> }</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><p class="" style="margin: 0px; line-height: normal; min-height: 13px;"> <br class="webkit-block-placeholder"></p></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> _getObjectiveCType() -> <span class="" style="color: rgb(112, 61, 170);">Any</span>.Type {</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">return</span> <span class="" style="color: rgb(112, 61, 170);">NSValue</span>.<span class="" style="color: rgb(187, 44, 162);">self</span></div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> }</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><p class="" style="margin: 0px; line-height: normal; min-height: 13px;"> <br class="webkit-block-placeholder"></p></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">func</span> _bridgeToObjectiveC() -> <span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span> {</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">var</span> sself = <span class="" style="color: rgb(187, 44, 162);">self</span></div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(0, 132, 0);">// would need compiler to create the @encode()</span></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">return</span> <span class="" style="color: rgb(112, 61, 170);">NSValue</span>(&sself, withObjCType: <span class="" style="color: rgb(209, 47, 27);">"{MyCStyleStruct=if}"</span>)</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> }</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><p class="" style="margin: 0px; line-height: normal; min-height: 13px;"> <br class="webkit-block-placeholder"></p></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> _forceBridgeFromObjectiveC(source: <span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span>, <span class="" style="color: rgb(187, 44, 162);">inout</span> result: <span class="" style="color: rgb(79, 129, 135);">MyCStyleStruct</span>?) {</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> source.<span class="" style="color: rgb(61, 29, 129);">getValue</span>(&result)</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> }</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><p class="" style="margin: 0px; line-height: normal; min-height: 13px;"> <br class="webkit-block-placeholder"></p></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> _conditionallyBridgeFromObjectiveC(source: <span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span>, <span class="" style="color: rgb(187, 44, 162);">inout</span> result: <span class="" style="color: rgb(79, 129, 135);">MyCStyleStruct</span>?) -> <span class="" style="color: rgb(112, 61, 170);">Bool</span> {</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> <span class="" style="color: rgb(49, 89, 93);">_forceBridgeFromObjectiveC</span>(source, result: &result)</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal; color: rgb(187, 44, 162);"><span class="" style="color: rgb(0, 0, 0);"> </span>return<span class="" style="color: rgb(0, 0, 0);"> </span>true</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;"> }</div></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><div class="" style="margin: 0px; line-height: normal;">}</div></div></div></blockquote><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class=""><br class=""></font></span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class=""><br class=""></font></span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class=""><br class=""></font></span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class=""><br class=""></font></span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class="">Finally, consider <b class="">automatic bridging of</b> <b class="">RawRepresentable</b> <b class="">types</b> (enums) as well, making the _ObjectiveCBridgeable code implicit in the following:</font></span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class=""><br class=""></font></span></div><blockquote class="" style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">enum</span> MyEnum: <span class="" style="color: rgb(112, 61, 170);">Int</span> {</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">case</span> Zero = <span class="" style="color: rgb(39, 42, 216);">0</span></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">case</span> One = <span class="" style="color: rgb(39, 42, 216);">1</span></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">case</span> Two = <span class="" style="color: rgb(39, 42, 216);">2</span></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">case</span> Three = <span class="" style="color: rgb(39, 42, 216);">3</span></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">}</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><br class=""></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);"><span class="" style="color: rgb(187, 44, 162);">extension</span><span class="" style="color: rgb(0, 0, 0);"> </span><span class="" style="color: rgb(79, 129, 135);">MyEnum</span><span class="" style="color: rgb(0, 0, 0);"> : </span>_ObjectiveCBridgeable<span class="" style="color: rgb(0, 0, 0);"> {</span></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">typealias</span> _ObjectiveCType = <span class="" style="color: rgb(112, 61, 170);">NSNumber</span></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> _isBridgedToObjectiveC() -> <span class="" style="color: rgb(112, 61, 170);">Bool</span> {</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);"><span class="" style="color: rgb(0, 0, 0);"> </span>return<span class="" style="color: rgb(0, 0, 0);"> </span>true</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> }</div></div><div class="" style="margin: 0px; line-height: normal;"><p class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"> <br class="webkit-block-placeholder"></p></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> _getObjectiveCType() -> <span class="" style="color: rgb(112, 61, 170);">Any</span>.Type {</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">return</span> <span class="" style="color: rgb(112, 61, 170);">NSNumber</span>.<span class="" style="color: rgb(187, 44, 162);">self</span></div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> }</div></div><div class="" style="margin: 0px; line-height: normal;"><p class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"> <br class="webkit-block-placeholder"></p></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">func</span> _bridgeToObjectiveC() -> <span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span> {</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">return</span> <span class="" style="color: rgb(112, 61, 170);">NSNumber</span>(integer: <span class="" style="color: rgb(187, 44, 162);">self</span>.<span class="" style="color: rgb(79, 129, 135);">rawValue</span>)</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> }</div></div><div class="" style="margin: 0px; line-height: normal;"><p class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"> <br class="webkit-block-placeholder"></p></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> _forceBridgeFromObjectiveC(source: <span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span>, <span class="" style="color: rgb(187, 44, 162);">inout</span> result: <span class="" style="color: rgb(79, 129, 135);">MyEnum</span>?) {</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> result = <span class="" style="color: rgb(79, 129, 135);">MyEnum</span>(rawValue: source.<span class="" style="color: rgb(112, 61, 170);">integerValue</span>)</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> }</div></div><div class="" style="margin: 0px; line-height: normal;"><p class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"> <br class="webkit-block-placeholder"></p></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(187, 44, 162);">public</span> <span class="" style="color: rgb(187, 44, 162);">static</span> <span class="" style="color: rgb(187, 44, 162);">func</span> _conditionallyBridgeFromObjectiveC(source: <span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span>, <span class="" style="color: rgb(187, 44, 162);">inout</span> result: <span class="" style="color: rgb(79, 129, 135);">MyEnum</span>?) -> <span class="" style="color: rgb(112, 61, 170);">Bool</span> {</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> <span class="" style="color: rgb(49, 89, 93);">_forceBridgeFromObjectiveC</span>(source, result: &result)</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);"><span class="" style="color: rgb(0, 0, 0);"> </span>return<span class="" style="color: rgb(0, 0, 0);"> </span>true</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"> }</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">}</div></div></blockquote><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class=""><br class=""></font></span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class=""><br class=""></font></span></div><div class="" style="margin: 0px; line-height: normal;"><span class="" style="widows: 1;"><font color="#222222" face="arial, sans-serif" size="2" class=""><br class=""></font></span></div><div class="" style="widows: 1; margin: 0px; line-height: normal;"><font color="#222222" face="arial, sans-serif" size="2" class="">Opinions? Have any/all of these been discussed before?</font></div><div class="" style="widows: 1; margin: 0px; line-height: normal;"><font color="#222222" face="arial, sans-serif" size="2" class=""><br class=""></font></div><div class="" style="widows: 1; margin: 0px; line-height: normal;"><font color="#222222" face="arial, sans-serif" size="2" class="">Thanks!</font></div><div class="" style="widows: 1; margin: 0px; line-height: normal;"><font color="#222222" face="arial, sans-serif" size="2" class="">Mike</font></div></body></html>