Latest 0.1
Homepage https://github.com/stephsharp/MaskZoomTransition
License MIT
Platforms ios 9.0, requires ARC

A Material Design-style transition, inspired by this animation from Dmytro Prudnikov.

MaskZoomTransition

Definitions

smallView

The small view in the presenting view controller to transition from.

largeView

The large view in the presented view controller to transition to.

viewsToFadeIn

The views in the presented view controller that fade in at the end of the transition. (Optional)

Usage

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.
}

Other options

duration

Default duration is 0.25 seconds.

presenting

Default is YES. It’s set to NO when dismissing a view controller (see MZMaskZoomTransitioningDelegate).

dismissToZeroSize

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).

Installation

CocoaPods

To install via CocoaPods, add to your podfile:

pod 'MaskZoomTransition', '~> 0.1'

Acknowledgements

License

MaskZoomTransition is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "MaskZoomTransition",
    "version": "0.1",
    "summary": "A Material Design-inspired transition.",
    "homepage": "https://github.com/stephsharp/MaskZoomTransition",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "Stephanie Sharp",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/stephsharp/MaskZoomTransition.git",
        "tag": "v0.1"
    },
    "source_files": "MaskZoomTransition",
    "public_header_files": [
        "MaskZoomTransition/MZMaskZoomTransition.h",
        "MaskZoomTransition/MZMaskZoomTransitioningDelegate.h",
        "MaskZoomTransition/UIViewController+MZContentViewController.h"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This