Search code examples
iosanimationtransition

IOS equivalent of Android's Shared element transition


I was wondering if IOS has any type of transition animation similar to Android's Shared element transition. For those not familiar with what that is, it is essentially "reusing" a view from one screen to another. For example the text from your list on screen A is the header text on screen B, it will translate and scale the text so that it looks like it is moving into its proper place.


Solution

  • You can accomplish this same technique using auto-layout constraints.

    You can render a view on screen A at a small size (let's say in a list). Then when the user taps on this view to segue to screen B, you can render the view as the size of the screen.

    Using different auto-layout priorities, you can accomplish different layouts depending on the size of the view.