To run the example project, clone the repo, and run pod install
from the Example directory first.
If you're a SEGUE fan then you going to like this as HELL!!! 😃 Actually it is easy as breathing
Set your segue Kind to Show Detail
.
Create an instance of SHNDTransitionController
in your FirstViewController class 👇🏻
let transitionDelegate = SHNDTransitionController(animationDuration: 0.5,
presentTransitionMode: .downToUp,
dismissTransitionMode: .leftToRight)
presentTransitionMode
and dismissTransitionMode
are just two simple enums that represent mode of your transition animation.
This step happens in your func prepare(for segue: UIStoryboardSegue, sender: Any?)
like this 👇🏻
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard let destination = segue.destination as? SecondViewController else { return }
destination.transitioningDelegate = self.transitionDelegate
}
In your SecondViewController class, you should just dismiss the UIViewController, in here i dismissed it with an UIButton, you can dismiss it with anything you want
@IBAction func dismissVC(_ sender: UIButton) {
self.dismiss(animated: true, completion: nil)
}
and do whatever you want in completion handler closure. In this case i just used nil
iOS 9.0+
Xcode 10.1
Swift 4.0 or later
SHNDTransition is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SHNDTransition', '~> 0.1.2'
[email protected], [email protected]
SHNDTransition is available under the MIT license. See the LICENSE file for more info.