Using Transaction, you will handle the flow between your segues much easier.
Add the following to your Podfile:
pod 'Transaction'
You will also need to make sure you're opting into using frameworks:
use_frameworks!
Then run pod install
Use the table below to determine which versions of Transaction are compatible with your project.
Swift version | Transaction version |
---|---|
Swift 3 | v1.0.1 or later |
Swift 2.2 / Swift 2.3 | v1.0.0 |
import Transaction
override func viewDidLoad() {
super.viewDidLoad()
performSegue(withIdentifier: Segue.First.rawValue, sender: nil)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == Segue.First.rawValue {
animation.startOn(current: self,
destination: segue.destination,
animation: .transitionFlipFromRight)
} else if segue.identifier == Segue.Second.rawValue {
animation.startOn(current: self,
destination: segue.destination,
animation: .transitionFlipFromLeft)
}
}
- Storyboard
- ViewCode
Please, don't hesitate to file an issue if you have questions.
Bruno da Luz. GitHub 🐦 Twitter
This project is distributed under the MIT License