0

I am trying to create particular viewcontroller only portrait mode should not rotate landscape. I have change into storyboard but its not working.

#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
    return UIInterfaceOrientationMaskPortrait;
}
Apple_Ajay
  • 227
  • 4
  • 17
  • Hi, weelcome to this site. "It is not working" is not enough for us to work with. Please provide a (minimal, complete and verifyable example)[stackoverflow.com/help/mcve], this will help us help you. – joepd Dec 17 '15 at 11:41
  • Now I gave plz check it. Its not working for me@joepd – Apple_Ajay Dec 17 '15 at 11:43
  • Possible duplicate of [Xcode - Only ONE VIEW landscape mode](http://stackoverflow.com/questions/24928057/xcode-only-one-view-landscape-mode) – Mayank Patel Dec 17 '15 at 11:46
  • well. this method'd rather not be invoked at all if your view controller is in a navigation stack, because the navigation stack holder (`UITabbarController`, `UINavigationController`, etc...) handles the orientation support _in-house_. what you can do is make a subset of the navigation stack controller and override the related method by asking the currently visible view controller about the supported orientations. _violá_, job is done. – holex Dec 17 '15 at 11:46
  • http://stackoverflow.com/questions/27009979/ios-lock-a-specific-uiviewcontroller-to-a-specific-orientation please see this – Syed Ali Salman Dec 17 '15 at 11:47

0 Answers0