0
我在Appdelegate的didFinishLaunchingWithOptions方法中有一些代码,根据代码显示不同的ViewController。添加此代码后动画不显示方向将改变。但如果我删除此代码,然后动画shows.can有人解释我如何解决这个问题?这是代码。Orienatation动画不显示何时方向会改变ios Swift
self.window = UIWindow(frame: UIScreen.main.bounds)
let storyboard = UIStoryboard(name: "Main", bundle: nil)
var vc:UIViewController
if (UserDefaults.standard.object(forKey: "Person") as? Bool) == nil {
vc = storyboard.instantiateViewController(withIdentifier: "FirstNavigationView")
}else{
vc = storyboard.instantiateViewController(withIdentifier: "MainView")
}
self.window?.rootViewController = vc
self.window?.makeKeyAndVisible()
你可以告诉我你是如何改变之前设置RootViewController的和你不使用任何NavigationController的设置RootViewController的中你的项目。 – Aashish1aug