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

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -