I want to use SceneDelegate, UIWindowScene, UIWindowSceneDelegate and other UIScene related things.
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow.init(frame: windowScene.coordinateSpace.bounds)
window?.windowScene = windowScene
let vc = UIStoryboard(name: "FCBottomTabBar", bundle: nil).instantiateInitialViewController()!
window?.rootViewController = vc
window?.makeKeyAndVisible()
}
How can i dynamically lock the orientation for this window? For example for portrait
only? Dynamically means that in runtime when user interacts with something the orientation locks back to all.
For example for screen A i need to lock to only portrait orientation. For screen B to only landscape.