<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. &nbsp;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,&nbsp;<b class="">optional primitive types should map to optional NSNumber</b>. Currently, they only map to NSNumber when used in an array or dictionary. &nbsp;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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">var</span>&nbsp;optIntProperty:&nbsp;<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="">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">var</span>&nbsp;objc_optIntProperty:&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">get</span>&nbsp;{</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">guard</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;value =&nbsp;<span class="" style="color: rgb(187, 44, 162);">self</span>.<span class="" style="color: rgb(79, 129, 135);">optIntProperty</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">else</span>&nbsp;{</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">return</span>&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">return</span>&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">set</span>&nbsp;{</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">guard</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;value = newValue&nbsp;<span class="" style="color: rgb(187, 44, 162);">else</span>&nbsp;{</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">self</span>.<span class="" style="color: rgb(79, 129, 135);">optIntProperty</span>&nbsp;=&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">self</span>.<span class="" style="color: rgb(79, 129, 135);">optIntProperty</span>&nbsp;= 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;">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; }</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. &nbsp;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;">&nbsp;</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&nbsp;<b class="">C-style structs to bridge to NSValue by default.</b>&nbsp;&nbsp;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. &nbsp;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>&nbsp;<span class="" style="color: rgb(187, 44, 162);">struct</span>&nbsp;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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">var</span>&nbsp;intProp:&nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">var</span>&nbsp;doubleProp:&nbsp;<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);">&nbsp;</span><span class="" style="color: rgb(79, 129, 135);">MyCStyleStruct</span><span class="" style="color: rgb(0, 0, 0);">&nbsp;:&nbsp;</span>_ObjectiveCBridgeable<span class="" style="color: rgb(0, 0, 0);">&nbsp;{</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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">typealias</span>&nbsp;_ObjectiveCType =&nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">static</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;_isBridgedToObjectiveC() -&gt;&nbsp;<span class="" style="color: rgb(112, 61, 170);">Bool</span>&nbsp;{</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);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>return<span class="" style="color: rgb(0, 0, 0);">&nbsp;</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;">&nbsp; &nbsp; }</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;">&nbsp;&nbsp; &nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">static</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;_getObjectiveCType() -&gt;&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">return</span>&nbsp;<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;">&nbsp; &nbsp; }</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;">&nbsp;&nbsp; &nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;_bridgeToObjectiveC() -&gt;&nbsp;<span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span>&nbsp;{</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;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">var</span>&nbsp;sself =&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">return</span>&nbsp;<span class="" style="color: rgb(112, 61, 170);">NSValue</span>(&amp;sself, withObjCType:&nbsp;<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;">&nbsp; &nbsp; }</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;">&nbsp;&nbsp; &nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">static</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;_forceBridgeFromObjectiveC(source:&nbsp;<span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span>,&nbsp;<span class="" style="color: rgb(187, 44, 162);">inout</span>&nbsp;result:&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp; source.<span class="" style="color: rgb(61, 29, 129);">getValue</span>(&amp;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;">&nbsp; &nbsp; }</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;">&nbsp;&nbsp; &nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">static</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;_conditionallyBridgeFromObjectiveC(source:&nbsp;<span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span>,&nbsp;<span class="" style="color: rgb(187, 44, 162);">inout</span>&nbsp;result:&nbsp;<span class="" style="color: rgb(79, 129, 135);">MyCStyleStruct</span>?) -&gt;&nbsp;<span class="" style="color: rgb(112, 61, 170);">Bool</span>&nbsp;{</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;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(49, 89, 93);">_forceBridgeFromObjectiveC</span>(source, result: &amp;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);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>return<span class="" style="color: rgb(0, 0, 0);">&nbsp;</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;">&nbsp; &nbsp; }</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&nbsp;<b class="">automatic bridging of</b>&nbsp;<b class="">RawRepresentable</b>&nbsp;<b class="">types</b>&nbsp;(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>&nbsp;<span class="" style="color: rgb(187, 44, 162);">enum</span>&nbsp;MyEnum:&nbsp;<span class="" style="color: rgb(112, 61, 170);">Int</span>&nbsp;{</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">case</span>&nbsp;Zero =&nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">case</span>&nbsp;One =&nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">case</span>&nbsp;Two =&nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">case</span>&nbsp;Three =&nbsp;<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);">&nbsp;</span><span class="" style="color: rgb(79, 129, 135);">MyEnum</span><span class="" style="color: rgb(0, 0, 0);">&nbsp;:&nbsp;</span>_ObjectiveCBridgeable<span class="" style="color: rgb(0, 0, 0);">&nbsp;{</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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">typealias</span>&nbsp;_ObjectiveCType =&nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">static</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;_isBridgedToObjectiveC() -&gt;&nbsp;<span class="" style="color: rgb(112, 61, 170);">Bool</span>&nbsp;{</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);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>return<span class="" style="color: rgb(0, 0, 0);">&nbsp;</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;">&nbsp; &nbsp; }</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;">&nbsp;&nbsp; &nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">static</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;_getObjectiveCType() -&gt;&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">return</span>&nbsp;<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;">&nbsp; &nbsp; }</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;">&nbsp;&nbsp; &nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;_bridgeToObjectiveC() -&gt;&nbsp;<span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span>&nbsp;{</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">return</span>&nbsp;<span class="" style="color: rgb(112, 61, 170);">NSNumber</span>(integer:&nbsp;<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;">&nbsp; &nbsp; }</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;">&nbsp;&nbsp; &nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">static</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;_forceBridgeFromObjectiveC(source:&nbsp;<span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span>,&nbsp;<span class="" style="color: rgb(187, 44, 162);">inout</span>&nbsp;result:&nbsp;<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;">&nbsp; &nbsp; &nbsp; &nbsp; result =&nbsp;<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;">&nbsp; &nbsp; }</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;">&nbsp;&nbsp; &nbsp;<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;">&nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(187, 44, 162);">public</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">static</span>&nbsp;<span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;_conditionallyBridgeFromObjectiveC(source:&nbsp;<span class="" style="color: rgb(79, 129, 135);">_ObjectiveCType</span>,&nbsp;<span class="" style="color: rgb(187, 44, 162);">inout</span>&nbsp;result:&nbsp;<span class="" style="color: rgb(79, 129, 135);">MyEnum</span>?) -&gt;&nbsp;<span class="" style="color: rgb(112, 61, 170);">Bool</span>&nbsp;{</div></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span class="" style="color: rgb(49, 89, 93);">_forceBridgeFromObjectiveC</span>(source, result: &amp;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);">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span>return<span class="" style="color: rgb(0, 0, 0);">&nbsp;</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;">&nbsp; &nbsp; }</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>