これらの質問から次のコードを使用して、回転アニメーションを無効にしました。これはiPhoneデバイスでは機能しますが、iPadsでは機能しません。iPhoneおよびiPadデバイスの回転アニメーションを無効にする方法
問題のビューコントローラは、モーダルに表示されているナビゲーションコントローラのルートビューコントローラです。
次の方法がiPhoneでは動作しますが、iPadでは動作しない理由は誰にも分かりますか?
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
coordinator.animate(alongsideTransition: nil) { _ in UIView.setAnimationsEnabled(true) }
UIView.setAnimationsEnabled(false)
super.viewWillTransition(to: size, with: coordinator)
}
StackOverflowの質問
Disable orientation change rotation animation
In 7.3/9/2+ Swift how to disable rotation animation, when device rotates?