Israel Roth
Israel Roth

Reputation: 441

Making an image move from one view controller to another

In the native Photos app on the iPhone, when I share an image by email, a nice animation sequence happens:

  1. The image shrinks to the center of the screen
  2. the mail composer slides UNDER the image
  3. the image is scaled and positioned in the message

How can I achieve a similar effect with my own view controllers? My situation is that I have the image in view controller A, I want to present view controller B modally by sliding it in UNDER the image, and then move the image onto its position within view controller B.

Upvotes: 3

Views: 561

Answers (1)

DHamrick
DHamrick

Reputation: 8488

  1. Remove the imageView from ViewController A and add it to the keyWindow object
  2. Present ViewController B modally
  3. Add the ImageView to ViewController B after the animation finishes

Upvotes: 1

Related Questions