DCModalSegue is a subclass of UIStoryboardSegue which make a slight pushed back animation when presented. The presenting animation is inspired by Gmail App and Sunrise Calendar.
With [CocoaPods] (http://cocoapods.org/), just add line below to your Podfile
then pod install
,
pod 'DCModalSegue'
Otherwise, download manually and then drag DCModalSegue folder to your Xcode project.
Finally, ensure QuartzCore.framework is added to your project.
Create segue in storyboard:
custom
.DCModalSegue
in the Segue Class
field inside the inspector.To dismiss the presented view controller, use [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
instead of [self dismissViewControllerAnimated:YES completion:nil];
There is also an unwind segue action created for you (thus no code is needed to dismiss the controller),
you can set up the dismiss action by control drag to the exit icon (see below) and select the action modalDonePresenting:
.
As an experimental project, there are a lot could be done better. So feel free to fork or submit an issue. :-)
Some ideas from KNSemiModalViewController and GC3DFlipTransitionStyleSegue.
Created by David Chang.
It's MIT Licese. See file LICENSE for more info.