CODEX – 6 KEEP LANCSCAPE OR PORTRAIT SCREEN SWIFT

Keep Your Screen Potrait or Landscape

override func shouldAutorotate() -> Bool{

return false

}

override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask
{

return InterfaceOrientationMask.Protrait
}

To Keep Landscape Right & Left

override func shouldAutorotate() -> Bool{

return true
}


override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask
{

return [InterfaceOrientationMask.LandscapeLeft,InterfaceOrientationMask.LandscapeRight]
}

Leave a Reply

Your email address will not be published. Required fields are marked *