How to perform custom animation using segues?

13,222

Ok, I finally found all the answers here: http://www.appcoda.com/custom-segue-animations/

Creating a custom segue is not difficult at all, as it consists of a standard programming technique in iOS. What is actually only required, is to subclass the UIStoryboardSegue class and override just one method, named perform. In this method the custom animation logic must be implemented. Triggering the transition from a view controller to another and back must also be programmatically performed by the developers, but this is a totally standard procedure.

Share:
13,222
Abubakr Dar
Author by

Abubakr Dar

Missing iOS development.

Updated on June 29, 2022

Comments

  • Abubakr Dar
    Abubakr Dar almost 2 years

    In Storyboards, you can customize the transition by clicking on the segue (the circle symbol between the two screens) and set the Transition to "Cover Vertical", "Flip Horizontal", "Cross Dissolve" or "Partial Curl" (you can uncheck "Animate" if you don’t want any animation at all).

    If I use a Storyboard, is it possible to customize this transition by code?

    • Admin
      Admin over 8 years
      @Abubakr Dar: I appreciated the title edit, thanks :-)
    • codeslapper
      codeslapper almost 6 years
      Do not see these in xCode 9.4. :-(
    • Admin
      Admin almost 6 years
      @codeslapper I'm not sure but maybe if you choose Custom, then you can code your own transition (eg. using transitionFlipFromLeft. This is an example, even if this is NOT about viewcontrollers transition: youtube.com/watch?v=4kSLbuB-MlU)