Last active
October 7, 2015 20:47
-
-
Save jungchris/80772b2dd70bb0588518 to your computer and use it in GitHub Desktop.
Video Player View Controller Force Rotate Back to Portrait
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewWillDisappear:(BOOL)animated { | |
[super viewWillDisappear:animated]; | |
// check if exiting | |
if (self.isMovingFromParentViewController) { | |
NSLog(@"isMovingFromParentViewController"); | |
// set public property to indicate this view will not longer be presented | |
self.isPresented = NO; | |
// forces a return to portrait orientation | |
NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait]; | |
[[UIDevice currentDevice] setValue:value forKey:@"orientation"]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment