Skip to content

Latest commit

 

History

History
79 lines (51 loc) · 2.63 KB

README.md

File metadata and controls

79 lines (51 loc) · 2.63 KB

SHNDTransition

swift-version Version License Platform

Example

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

Step 1

Set your segue Kind to Show Detail.

step 1

Step 2

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.

Step 3

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
}

Step 4

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

Requirements

iOS 9.0+

Xcode 10.1

Swift 4.0 or later

Installation

SHNDTransition is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SHNDTransition', '~> 0.1.2'

Author

[email protected], [email protected]

License

SHNDTransition is available under the MIT license. See the LICENSE file for more info.