<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I spoke too soon, the cases are also defined as values of that type. So, a working version of your code:<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">extension</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">fe_type</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> : </span>CustomStringConvertible<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> {</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">public</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> description: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span> {</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>switch<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>self<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> {</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>case<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">FE_QPSK</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">: </span>return<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"QPSK"</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>case<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">FE_QAM</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">: </span>return<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"QAM"</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>case<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">FE_OFDM</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">: </span>return<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"OFDM"</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>case<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">FE_ATSC</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">: </span>return<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"ATSC"</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">default</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">fatalError</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span>"can't be exhaustive"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">}</div><div class=""><br class=""></div><div class="">Best,</div><div class="">Austin</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 10, 2016, at 1:22 PM, Austin Zheng <<a href="mailto:austinzheng@gmail.com" class="">austinzheng@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Ryan,</div><div class=""><br class=""></div><div class="">Apologies, I should have been more clear. In Xcode you can alt(?)-click on a type (e.g the 'MyType' in "let a : MyType = 123") in the IDE to pop up a little window that shows you the definition, including the type and some other information. If you're on a Linux box or not using an IDE you probably don't have that option.</div><div class=""><br class=""></div><div class="">The only methods I see exposed on the Swift imported type are initializers taking a integer raw value, and a 'rawValue' property for getting back out the raw value. Hope that helps.</div><div class=""><br class=""></div><div class="">Austin</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 10, 2016, at 1:18 PM, Ryan Lovelett <<a href="mailto:swift-dev@ryan.lovelett.me" class="">swift-dev@ryan.lovelett.me</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<title class=""></title>
<div class=""><div class="">Austin,<br class=""></div>
<div class=""> </div>
<div class="">I guess I should say that the `typedef` is coming from a <a href="http://lxr.free-electrons.com/source/include/linux/dvb/frontend.h?v=3.2" class="">Linux kernel header</a>. So I don't think I'm going to be able to add any macros to the definition.<br class=""></div>
<div class=""> </div>
<div class="">What do you mean about alt-click? Alt click where?<br class=""></div>
<div class=""> </div>
<div class="">On Sun, Jan 10, 2016, at 04:12 PM, Austin Zheng wrote:<br class=""></div>
<blockquote type="cite" class=""><div class="">fe_type is being imported as a struct (alt-click 'fe_type' in Swift). I think if you want it to be imported as an enum you need to use the NS_ENUM macro in the definition, which might not be possible in your case.<br class=""></div>
<div class=""> </div>
<div class=""><div class="">Austin<br class=""></div>
<div class=""><div class=""> </div>
<div class=""><blockquote type="cite" class=""><div class="">On Jan 10, 2016, at 1:06 PM, Ryan Lovelett via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>> wrote:<br class=""></div>
<div class=""> </div>
<div class=""><div class=""><span class="font" style="font-family:Helvetica"><span class="size" style="font-size:12px">typedef enum fe_type {</span></span><br class=""></div>
<div class=""><span class="font" style="font-family:Helvetica"><span class="size" style="font-size:12px"> FE_QPSK,</span></span><br class=""></div>
<div class=""><span class="font" style="font-family:Helvetica"><span class="size" style="font-size:12px"> FE_QAM,</span></span><br class=""></div>
<div class=""><span class="font" style="font-family:Helvetica"><span class="size" style="font-size:12px"> FE_OFDM,</span></span><br class=""></div>
<div class=""><span class="font" style="font-family:Helvetica"><span class="size" style="font-size:12px"> FE_ATSC</span></span><br class=""></div>
<div class=""><span class="font" style="font-family:Helvetica"><span class="size" style="font-size:12px">} fe_type_t;</span></span><br class=""></div>
</div>
</blockquote></div>
</div>
</div>
</blockquote><div class=""> </div>
</div>
</div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></body></html>