TTZoomTransition
TTZoomTransition is a custom modal view controller transition which displays the presented view controller by zoom animation.
Installation
You can use TTZoomTransition via CocoaPods. Add the following line to your Podfile:
Podfile
pod TTZoomTransitionUsage
Set modalPresentationStyle property of your modal view controller to UIModalPresentationCustom. Also set the transitioningDelegate property.
ModalViewController* modalVC = [[ModalViewController alloc] init];
modalVC.modalPresentationStyle = UIModalPresentationCustom;
modalVC.transitioningDelegate = self;
[self presentViewController:modalVC animated:YES completion:nil];In your transitioning delegate implement the following methods of UIViewControllerTransitioningDelegate:
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source
{
TTZoomTranstition* zoomTransition = [[TTZoomTranstition alloc] init];
return zoomTransition;
}
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed
{
TTZoomTranstition* zoomTransition = [[TTZoomTranstition alloc] init];
zoomTransition.presenting = NO;
return zoomTransition;
}Demo
pod try TTZoomTransitionIf you don't have CocoaPods on your machine, get it: [sudo] gem install cocoapods.
Requirements
- iOS 9+
Contact
Tamás Tímár
License
TTZoomTransition is available under the MIT license. See the LICENSE file for more info.
Acknowledgements
Images in example are from Pixabay.
