Aleksandar • Vacić

iOS bits and pieces

How to support landscape mode in your app on iPhone 6

In your AppDelegate file, add this:

1
2
3
4
5
6
7
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {

  if (window && window.bounds.size.width <= 320)
      return UIInterfaceOrientationMaskPortrait;
  
  return UIInterfaceOrientationMaskAll;
}

This will force portrait only in iPhone 5s or older and enable all orientations in iPhone 6 and up and all iPads.