> On 17 Jul 2017, at 15:15, Michael Rogers via swift-users 
> <swift-users@swift.org> wrote:
> 
> Hi, All:
> 
> 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?

Sure - it's because it's an alias that is imported via Objective-C rather than 
defined in Swift:

typedef NS_ENUM(NSInteger, UIModalPresentationStyle) {
        UIModalPresentationFullScreen = 0,
        UIModalPresentationPageSheet NS_ENUM_AVAILABLE_IOS(3_2) 
__TVOS_PROHIBITED,
        UIModalPresentationFormSheet NS_ENUM_AVAILABLE_IOS(3_2) 
__TVOS_PROHIBITED,
        UIModalPresentationCurrentContext NS_ENUM_AVAILABLE_IOS(3_2),
        UIModalPresentationCustom NS_ENUM_AVAILABLE_IOS(7_0),

(you can see this in the UIViewController.h file in the UIKit, which is found 
underneath your Xcode install)

The importer notes that the name of such typedef'd constants effectively become 
translated into an enum as far as Swift source code is concerned, but it's a 
different kind of case.

Having said that, it might be a bug in the case that the description of the 
constant isn't the name of the element type. It would be worth raising this on 
bugs.swift.org and use this example in case there's something that can be done 
to fix it.

Alex

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to