Skip to content

Instantly share code, notes, and snippets.

Created February 25, 2015 23:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source
// Here, we'll provide the presentation controller to be used for the presentation
Class presentationControllerClass;
// If our presentation should be awesome, return the AAPLCoolPresentationController. We determine this based on -[AAPLRootViewController presentationShouldBeAwesome]
if([source isKindOfClass:[AAPLRootViewController class]] && [(AAPLRootViewController *)source presentationShouldBeAwesome])
presentationControllerClass = [AAPLCoolPresentationController class];
presentationControllerClass = [AAPLOverlayPresentationController class];
return [[presentationControllerClass alloc] initWithPresentedViewController:presented presentingViewController:presenting];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment