最終更新:2017-06-07 (水) 05:38:48 (2508d)  

UIViewController supportedInterfaceOrientations
Top / UIViewController supportedInterfaceOrientations

Returns all of the interface orientations that the view controller supports.

- (NSUInteger)supportedInterfaceOrientations

  • UIInterfaceOrientationMask
    typedef enum {
       UIInterfaceOrientationMaskPortrait = (1 << UIInterfaceOrientationPortrait),
       UIInterfaceOrientationMaskLandscapeLeft = (1 << UIInterfaceOrientationLandscapeLeft),
       UIInterfaceOrientationMaskLandscapeRight = (1 << UIInterfaceOrientationLandscapeRight),
       UIInterfaceOrientationMaskPortraitUpsideDown = (1 << UIInterfaceOrientationPortraitUpsideDown),
       UIInterfaceOrientationMaskLandscape =
       (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight),
       UIInterfaceOrientationMaskAll =
       (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft |
       UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown),
       UIInterfaceOrientationMaskAllButUpsideDown =
       (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft |
       UIInterfaceOrientationMaskLandscapeRight),
    } UIInterfaceOrientationMask;

現在の端末の方向

[[UIDevice currentDevice] orientation]