<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=""><span class="Apple-tab-span" style="white-space:pre">        </span>Certain Objective-C enums don’t print a useful debug description. I usually work around this by implementing CustomStringConvertible (or the debug version) for the type myself. You probably want to file a bug with Apple.<div class=""><br class=""></div><div class=""><br class=""></div><div class="">Jon</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 17, 2017, at 6:15 PM, Michael Rogers via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi, All:<div class=""><br class=""></div><div class="">Can someone please enlighten me as to why the first enum works as expected, giving me Melbourne, but the second gives UIModalPresentationStyle rather than fullScreen? </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="color: #0433ff" class="">enum</span> City {</div><div style="margin: 0px; line-height: normal;" class=""> <span style="color: #0433ff" class="">case</span> Melbourne, Chelyabinsk, Bursa</div><div style="margin: 0px; line-height: normal;" class="">}</div><div style="margin: 0px; line-height: normal;" class=""><span style="color: #0433ff" class="">let</span> city = <span style="color: #3495af" class="">City</span>.<span style="color: #3495af" class="">Bursa</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(52, 149, 175);" class="">print<span style="" class="">(</span>city<span style="" class="">)</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 143, 0);" class="">// prints "Melbourne"</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(0, 143, 0);" class=""><span style="color: #0433ff" class="">let</span><span style="" class=""> cityName = </span><span style="color: #b4261a" class="">"</span><span style="" class="">\</span><span style="color: #b4261a" class="">(</span><span style="color: #3495af" class="">city</span><span style="color: #b4261a" class="">)"</span><span style="" class=""> </span>// or `let cityName = String(city)`</div><div style="margin: 0px; line-height: normal; color: rgb(0, 143, 0);" class="">// cityName contains "Melbourne"</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(0, 143, 0);" class="">// Why doesn't the following work?</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(52, 149, 175);" class=""><span style="color: #0433ff" class="">let</span><span style="" class=""> presStyle = </span>UIModalPresentationStyle<span style="" class="">.</span>fullScreen</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(0, 143, 0);" class=""><span style="color: #3495af" class="">print</span><span style="" class="">(</span><span style="color: #3495af" class="">presStyle</span><span style="" class="">) </span>// prints UIModalPresentationStyle</div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Helvetica; min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="color: #0433ff" class="">let</span> presStyleName = <span style="color: #b4261a" class="">"</span>\<span style="color: #b4261a" class="">(</span><span style="color: #3495af" class="">presStyle</span><span style="color: #b4261a" class="">)"</span></div></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I have an ugly work-around using String UIPresentationStyle tuples, but I'd rather not use it if possible.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">Michael<br class=""><div class="">---------------------------------------------------------------------------</div></div><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Dr. Michael P. Rogers<br class="">Associate Professor, Northwest Missouri State University<br class="">Tinkerer-in-Chief and Angel Flight Pilot<br class="">Twitter & Google+: <a href="mailto:mprogers@mac.com" class="">mprogers@mac.com</a>; Skype: <a href="http://mprogersatmac.com/" class="">mprogersatmac.com</a>; Facebook: mprogers<br class="">Phone: 309-825-6454 (H); 660-562-1551 (W)<br class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Thank you, thank you, thank you, and I'd like to thank all the little people -- Tom Thumb, Ant-Man, and, of course, all the Lilliputians -- who made this award possible 😀</div>
</div>
<br class=""></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></div></body></html>