Created
November 21, 2019 20:41
-
-
Save shanecowherd/2a4b2258e15a350711196dc01c79f7e1 to your computer and use it in GitHub Desktop.
When you rotate a screen, prevent animations and just snap into place
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When you rotate a screen, prevent animations and just snap into place | |
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) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment