I am using:
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
How would I use this for Portrait and Upside down in iOS6?
this works for landscape left UIInterfaceOrientationMaskLandscapeLeft
and this for Landscape right UIInterfaceOrientationMaskLandscapeRight
and this for both landscapes UIInterfaceOrientationMaskLandscape
Swipe down from the top-right corner of your screen to open Control Center. Tap the Portrait Orientation Lock button to make sure that it's off. Turn your iPhone sideways.
Swipe up from the bottom edge of your screen to open Contol Center. Tap the Portrait Orientation Lock button to make sure that it's off. That's it.
You need to return a valid bitmask of the orientations you wish to support:
For portrait and portrait upside down:
- (NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
You can see a list of the supported orientation masks
It's important to note also, that you need to list portrait upside down in your supported orientations as well:
You need to use the bitwise OR operator for each supported orientation.
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait |
UIInterfaceOrientationMaskPortraitUpsideDown;
}
Add another bitwise OR for each orientation you want to support. Typically, when you see a constant with the word "mask" in it, they are meant to be combined in this way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With