Skip to content

Instantly share code, notes, and snippets.

@Banck
Last active January 25, 2018 07:56
Show Gist options
  • Save Banck/254ddb74438afad8074f96cdb1196c85 to your computer and use it in GitHub Desktop.
Save Banck/254ddb74438afad8074f96cdb1196c85 to your computer and use it in GitHub Desktop.
-(UIInterfaceOrientationMask)application:(UIApplication* )application supportedInterfaceOrientationsForWindow:(UIWindow* )window {
id presentedViewController = [window.rootViewController presentedViewController];
NSString *className = presentedViewController ? NSStringFromClass([presentedViewController class]) : nil;
if (window && [className isEqualToString:@"SKStoreProductViewController"])
return UIInterfaceOrientationMaskLandscape;
else
return UIInterfaceOrientationMaskPortrait;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment