Group Group Group Group Group Group Group Group Group

raywenderlich.com Forums

Video Tutorial: Beginning iOS Animation Part 8: Beginning View Controller Transitions

Learn how to create simple View Controller transition animations.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3422-beginning-ios-animation/lessons/9

Hi Marin, nice video, this help me a lot to learn iOS animation, I have 2 questions:

  1. Should you have started your second animation in the completion block of the first one instead starting it with a delay that match the duration of the first one ?

  2. In the challenge, we add a dimming view to the animateTransition, should it have be done in a UIPresentationController in a separate class instead ?

Quick Tips: Instead of forcing the unwrap of the optionals at the top of animateTransition you could have used guard

thanks

  1. sometimes I prefer to use delay to make the code more readable (e.g. avoid pyramid of doom)
  2. if you prefer using a separate controller - do it :+1:

We get ‘extra argument ‘usingSpringWithDamping’ in call’.

Hi Marin,

Nice videos. I am a bit struggling to fix a bug that I found with animating the view controllers. Here is the scenario,

I open the app in any orientation, click on one of the images, rotate the device, click again on the image to dismiss the HerbDetailsViewController. the result is that the main view controller layout still thinks that it is the old orientation and it doesn’t update itself to correspond to the new orientation. Any help explaining that is appreciated.

Thanks

Hey yeah, that’s part of UIKit’s policies. The presented view controllers don’t propagade orientation changes to their presenters.

this happens only when I do custom animations but if I go with the default animations, the presenting viewcontroller corresponds to orientation changes. I was wondering how should I go about fixing that.

Thanks