Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

swift - iOS 9 Orientation Auto-Rotation Animation Not Working, But Always on Main Thread

iOS 9.0 (13A340) Xcode 7.0 (7A220) OS X 10.10.5 (14F27)

I have a situation where if I rotate the simulator or device (using iPhone 6s sim and iPhone 6+ device), the animation does not also take place. I am unsure of why this is happening. I am not doing anything unusual or crazy with any UIKit methods, and I am not calling any method not on the main thread. Additionally, other UIView animations I have added appear to work just fine. It is just the rotation that's broken. Other apps seem fine. I'm not sure what I could be doing wrong.

No rotation animation

Attempts to figure out/solve:

  • Used this extension by Cocoanetics to attempt to see if any UIKit execution was not on the main thread.
  • Printed out the value of UIView.areAnimationsEnabled() during multiple spots in program execution. It always printed true.
  • Setting UIView.setAnimationsEnabled(true) did not fix.

I am using a custom "nav" view controller (one I made): SASlideDrawer (Note I am not experiencing this same issue with this project alone)

Thank you.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In my case I had target's "Main Interface" set and in application:didFinishLaunchingWithOptions: I have been creating new window and new rootViewController


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...