Skip to content

Instantly share code, notes, and snippets.

@jungchris
Last active October 7, 2015 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jungchris/80772b2dd70bb0588518 to your computer and use it in GitHub Desktop.
Save jungchris/80772b2dd70bb0588518 to your computer and use it in GitHub Desktop.
Video Player View Controller Force Rotate Back to Portrait
- (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