0

I'm trying to allow rotation in my project (swift 3) only for one UIViewController. I use this code, but it doesn't work for me. What should i paste in my VC to allow user rotate it, but forbid to rotate all other VC-s? I have enabled Portrait Device Orientation in General settings of my project

override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        return UIInterfaceOrientationMask.all
    }

override var shouldAutorotate: Bool {
        return false
    }
coldembrace
  • 549
  • 8
  • 19
  • Returning `false` from `shouldAutorotate` if you _want_ to allow a different rotation is kind of self-defeating, wouldn't you say? – matt Feb 21 '17 at 15:33
  • http://stackoverflow.com/questions/17466048/how-to-allow-only-single-uiviewcontroller-to-rotate-in-both-landscape-and-portra – Nazmul Hasan Feb 21 '17 at 15:34

0 Answers0