Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override func viewDidLoad() {
- super.viewDidLoad()
- // Force the device in portrait mode when the view controller gets loaded
- UIDevice.currentDevice().setValue(UIInterfaceOrientation.Portrait.rawValue, forKey: "orientation")
- }
- override func shouldAutorotate() -> Bool {
- // Lock autorotate
- return false
- }
- override func supportedInterfaceOrientations() -> Int {
- // Only allow Portrait
- return Int(UIInterfaceOrientationMask.Portrait.rawValue)
- }
- override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
- // Only allow Portrait
- return UIInterfaceOrientation.Portrait
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement