美文网首页
Xcode11后的SceneDelegate,创建控制器

Xcode11后的SceneDelegate,创建控制器

作者: 凤起梧桐 | 来源:发表于2020-08-31 17:15 被阅读0次

    在SceneDelegate中:

    - (void)scene:(UIScene*)scenewillConnectToSession:(UISceneSession*)sessionoptions:(UISceneConnectionOptions*)connectionOptions {

        UIWindowScene*windowScene = (UIWindowScene*)scene;

          self.window = [[UIWindow alloc] initWithWindowScene:windowScene];

          self.window.frame = windowScene.coordinateSpace.bounds;

          self.window.rootViewController = [ViewController new];

          [self.window makeKeyAndVisible];

        // 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).

    }

    相关文章

      网友评论

          本文标题:Xcode11后的SceneDelegate,创建控制器

          本文链接:https://www.haomeiwen.com/subject/dmqpsktx.html