TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Feb 2016 |
Maintained by Stephanie Sharp.
A Material Design-style transition, inspired by this animation from Dmytro Prudnikov.
The small view in the presenting view controller to transition from.
The large view in the presented view controller to transition to.
The views in the presented view controller that fade in at the end of the transition. (Optional)
In the presenting view controller, initialise a property for the transitioning delegate:
self.transitioningDelegate = [MZMaskZoomTransitioningDelegate new];
Assign the smallView
and transitioningDelegate
in prepareForSegue:sender:
:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
self.transitioningDelegate.smallView = sender; // The view you are transitioning from.
...
segue.destinationViewController.transitioningDelegate = self.transitioningDelegate;
segue.destinationViewController.modalPresentationStyle = UIModalPresentationCustom;
}
Implement the MZMaskZoomTransitionPresentedViewController
protocol in the presented view controller:
@synthesize largeView, viewsToFadeIn;
- (NSArray *)viewsToFadeIn
{
return @[self.label1, self.label2, self.label3]; // Any views you want to fade in at the end of the transition.
}
- (UIView *)largeView
{
return self.someLargeView; // The view you are transitioning to.
}
Default duration is 0.25 seconds.
Default is YES. It's set to NO when dismissing a view controller (see MZMaskZoomTransitioningDelegate
).
Default is NO. Set to YES if you want the dismiss transition to shrink the view down to zero. This is useful if the smallView
in the presenting view controller is no longer visible (e.g. item was deleted).
MaskZoomTransition is released under the MIT license. See LICENSE for details.