So, (UIInterfaceOrientationMask.Portrait | 
UIInterfaceOrientationMask.LandscapeLeft) doesn't work?


> On Jul 12, 2016, at 11:25 AM, William Squires <[email protected]> wrote:
> 
> In iOS 8, I would (in a view controller):
> 
> ...
> override func supportedInterfaceOrientations() -> Int
> {
> return Int(UIInterfaceOrientationMask.Portrait.rawValue) | 
> Int(UIInterfaceOrientationMask.LandscapeLeft.rawValue)
> }
> ...
> 
> but this no longer works in iOS 9, as the method signature is now:
> 
> func supportedInterfaceOrientations() -> UIInterfaceOrientationMask
> 
> instead. So how do I cast the Int result above to a 
> UIInterfaceOrientationMask? I tried the obvious:
> 
> return 
> UIInterfaceOrientationMask(Int(UIInterfaceOrientationMask.Portrait.rawValue) 
> | Int(UIInterfaceOrientationMask.LandscapeLeft.rawValue))
> 
> but Xcode complains that UIInterfaceOrientationMask doesn't have an 
> initializer that takes "Int".
> 
> so what dumb Swift feature am I overlooking now?


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to