Skip to content

Instantly share code, notes, and snippets.

@0xced
Created July 22, 2015 10:33
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 0xced/c51946173412d17927f3 to your computer and use it in GitHub Desktop.
Save 0xced/c51946173412d17927f3 to your computer and use it in GitHub Desktop.
Reverse engineered implementation of -[MPMoviePlayerViewController _moviePlayerViewController_playbackDidFinishNotification:]
@implementation MPMoviePlayerViewController
- (void) _moviePlayerViewController_playbackDidFinishNotification:(NSNotification *)notification
{
if (self.presentingViewController.presentedViewController == self)
{
UIViewController *presentingViewController = self.presentingViewController;
if (self->_internal->_wasDisplayedAnimated)
[presentingViewController dismissMoviePlayerViewControllerAnimated];
else
[presentingViewController dismissViewControllerAnimated:NO completion:nil];
}
}
@end
@0xced
Copy link
Author

0xced commented Aug 4, 2015

Astute readers will notice that if MPMoviePlayerViewController is used as a child view controller, self.presentingViewController.presentedViewController == self will not be true and the movie player view controller will never be dismissed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment