Skip to content

Instantly share code, notes, and snippets.

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