ios - How to present ViewController in Landscape mode -


i want present uiview controller in landscape mode , disable other rotations uiviewcontroller. tried following, user can still rotate out of landscape.

override func viewdidload() {     super.viewdidload()     applylandscapeandlock()     build()     // additional setup after loading view. }  override func preferredinterfaceorientationforpresentation() -> uiinterfaceorientation {     return uiinterfaceorientation.landscapeleft }  override func shouldautorotate() -> bool {     return false }  override func supportedinterfaceorientations() -> int {     return uiinterfaceorientation.landscapeleft.rawvalue }  func applylandscapeandlock() {     let value = uiinterfaceorientation.landscapeleft.rawvalue     uidevice.currentdevice().setvalue(value, forkey: "orientation") } 


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

spring cloud - How to configure SpringCloud Eureka instance to point to https on non standard port -

javascript - Bootstrap Popover: iOS Safari strange behaviour -