Open jiangleligejiang opened 4 years ago
iOS13后,需要在SceneDelegate
中willConnectToSession
方法中去自定义viewcontroller
(void)scene:(UIScene )scene willConnectToSession:(UISceneSession )session options:(UISceneConnectionOptions )connectionOptions {
// Use this method to optionally configure and attach the UIWindow window
to the provided UIWindowScene scene
.
// If using a storyboard, the window
property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see application:configurationForConnectingSceneSession
instead).
UIWindowScene windowScene = (UIWindowScene )scene;
self.window = [[UIWindow alloc] initWithWindowScene:windowScene];
self.window.backgroundColor = [UIColor purpleColor];
UIViewController VC = [[UIViewController alloc]init];
UINavigationController *NVC = [[UINavigationController alloc]initWithRootViewController:VC];
[self.window setRootViewController:NVC];
[self.window makeKeyAndVisible];
}
删除StoryBoard方法
Scene Session
,需要删除info.plist中的application scene manifest中对应的storyboard文件