ios - Orientation Lock of UIViewController - Xcode - Swift -
ios - Orientation Lock of UIViewController - Xcode - Swift -
this question has reply here:
setting device orientation in swift ios 11 answers how forcefulness view controller orientation in ios 8? 12 answershow forcefulness view controller remain in portrait mode programmatically? have created share extension ios app , need view remain in portrait mode of time, despite orientation of device. override methods below not work:
override func supportedinterfaceorientations() -> int { homecoming int(uiinterfaceorientation.portrait.rawvalue) } override func preferredinterfaceorientationforpresentation() -> uiinterfaceorientation { homecoming uiinterfaceorientation.portrait } override func shouldautorotate() -> bool { homecoming false }
you can utilize code in viewwillapear
allow value = uiinterfaceorientation.portrait.rawvalue uidevice.currentdevice().setvalue(value, forkey: "orientation")
ios cocoa-touch swift uiviewcontroller
Comments
Post a Comment