willAnimateRotationToInterfaceOrientation not called on popViewControllerAnimated

后端 未结 5 1632
遇见更好的自我
遇见更好的自我 2020-12-14 12:08

In the MainViewController I have to adjust some images on orientation change. Easy - just add the code to the willAnimateRotationToInterfaceOrientation: callback

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-14 13:02

    I have also experienced this behavior, and I think it's because of performance and architectural reasons; AFAIK this method is called inside a UIView animation context (which allows you to change frames and centers, and have a nice animation while everything rotates) and when your view controller is not visible, either UIKit avoids executing this method, or simply it's impossible to execute it, because the view is not visible (and probably you can't animate what you can see). Again, this is pure speculation :)

提交回复
热议问题