0

I'm a big noob when it comes to swift and iOS app implementation.

So what Im trying to do and not sure if possible.

So I created a WKWebView and added UIImage and ProgressView to my viewDidLoad() function. Once the webiste finishes loading I remove both views in didFinish function. So I would like once the didFinish is called to be able to enable the screen to rotate, Not force it enable it. So if a user is in landscape the website only can be used in landscape.

In general I created a loader screen for my WKWebView and I want it to always be in portrait mode but once site is loaded to be flexible to change from portrait to landscape as normal.

Thanks in advance

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
Laurence Nicolaou
  • 569
  • 2
  • 8
  • 28

1 Answers1

0

In the function "supportedInterfaceOrientations", you can return the required orientation after checking whether your webview is loading or not. Then, after webview finished loading and your device is in landscape, you should change the orientation programmatically (How do I programmatically set device orientation in iOS7?)

Tinku George
  • 585
  • 5
  • 14