Skip to content

Instantly share code, notes, and snippets.

@jungchris
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
Embed
What would you like to do?
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