ios - Orientation of screen? -


how make sure orientations allowed portrait or upside down portrait?

i made change in project settings, i'm having trouble making change in gameviewcontroller.

i need make change in function:

override func supportedinterfaceorientations() -> uiinterfaceorientationmask {     if uidevice.currentdevice().userinterfaceidiom == .phone {         return .allbutupsidedown     } else {         return .all     } } 

however, "uiinterfaceorientationmask" structure doesn't have option allows portrait , upside down portrait.

you have allow orientations in project settings, orientations allowed portrait or upside down portrait in viewcontroller except gameviewcontroller:

// baseviewcontroller override func supportedinterfaceorientations() -> uiinterfaceorientationmask {     if uidevice.currentdevice().userinterfaceidiom == .phone {         return uiinterfaceorientationmask.portrait.rawvalue | uiinterfaceorientationmask.portraitupsidedown.rawvalue     } else {         return .all     } } 

finally in gameviewcontroller:

override func supportedinterfaceorientations() -> uiinterfaceorientationmask {     if uidevice.currentdevice().userinterfaceidiom == .phone {         return .allbutupsidedown     } else {         return .all     } } 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -