• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
specifying UIInterfaceOrientationMask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

specifying UIInterfaceOrientationMask


  • Subject: specifying UIInterfaceOrientationMask
  • From: William Squires <email@hidden>
  • Date: Tue, 12 Jul 2016 13:25:29 -0500

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@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: specifying UIInterfaceOrientationMask
      • From: Quincey Morris <email@hidden>
    • Re: specifying UIInterfaceOrientationMask
      • From: Steve Christensen <email@hidden>
  • Prev by Date: Best way to model something that's drawable (i.e. has a visual representation in the UI)
  • Next by Date: Re: Best way to model something that's drawable (i.e. has a visual representation in the UI)
  • Previous by thread: Re: Best way to model something that's drawable (i.e. has a visual representation in the UI)
  • Next by thread: Re: specifying UIInterfaceOrientationMask
  • Index(es):
    • Date
    • Thread