I created a segue between two controllers(A, B). In controller A, I am using "performSegueWithIdentifier" method to show controller B's view. However, I want to add an animation on presenting the B. I want it to show/hide from the bottom of the screen. How should I do this?
Asked
Active
Viewed 1,258 times
1
-
1What kind of segue is it? Push/show, or present/modal? – matt Feb 21 '16 at 02:21
-
Simply do a custom presentation transition animation, using UIViewControllerAnimatedTransitioning. – matt Feb 21 '16 at 10:44
1 Answers
2
I achieved this using Present As Popover when choosing the kind of segue in Attributes Inspector. Make sure you point your anchor to the view controller you are segueing from, this answer was pretty helpful.
Make sure you give it an identifier (using this identifier below) and use the typical perform segue code whenever you wish to perform the segue:
dispatch_async(dispatch_get_main_queue()) {
[unowned self] in
self.performSegueWithIdentifier("Identifier", sender: self)
}
Make sure you replace "Identifier" string with a string of your own segue identifier.