I'm using presentViewController to change from a view to another without Navigation Controller like:
let HomeView = self.storyboard!.instantiateViewControllerWithIdentifier("HomeView") as! ViewControllerHome self.presentViewController(HomeView, animated:true, completion: nil)
How to change the transition? I want to the same animation like the Navigation controller.
I can use another transitions, but I don't find the transition I want here is the code I'm using
let HomeView = self.storyboard!.instantiateViewControllerWithIdentifier("HomeView") as! ViewControllerHome HomeView.modalTransitionStyle = UIModalTransitionStyle.PartialCurl self.presentViewController(HomeView, animated:true, completion: nil)
Transitions are animations used to keep users oriented during user interface (UI) state changes and object manipulations, and make those changes feel smooth instead of jarring.
The answer of Mehul is correct but you can also do it the way you want it. With the instantiateViewController(withIndentifier: string)
This is how I do it:
let destController = self.storyboard?.instantiateViewController(withIdentifier: "") as! YourViewController destController.modalTransitionStyle = .flipHorizontal self.navigationController?.present(destController, animated: true, completion: nil) // OR let destController = self.storyboard?.instantiateViewController(withIdentifier: "") as! YourViewController destController.modalTransitionStyle = .flipHorizontal self.present(destController, animated: true, completion: nil)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With