Created
December 14, 2017 05:06
-
-
Save jazzedge/bb58289fccbc281e403b68d7399d8fef to your computer and use it in GitHub Desktop.
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
See: https://stackoverflow.com/questions/26943808/ios-how-to-run-a-function-after-device-has-rotated-swift | |
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { | |
super.viewWillTransition(to: size, with: coordinator) | |
if UIDevice.current.orientation.isLandscape { | |
print("Landscape") | |
} else { | |
print("Portrait") | |
} | |
//Code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment