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 answers

how 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

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -