Skip to content

Instantly share code, notes, and snippets.

@jungchris
Created February 25, 2015 23:30
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/654f9bc21be8b15e049a to your computer and use it in GitHub Desktop.
Save jungchris/654f9bc21be8b15e049a to your computer and use it in GitHub Desktop.
OverlayTransitioner
- (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];
}
else
{
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