修改项目配置文件

      1、选中项目文件->TARGETS->General;

      2、清空Deployment Info栏目的 Main Interface项。

swift 4.0 代码设置启动后的第一个页面

 

修改AppDelegate.swift文件

      1、选中AppDelegate.swift文件;

      2、重写application didFinishLaunchingWithOptions方法;

      3、实例化window(因为删除Main.storyboard,要创建一个填充回来);

      4、设置window的rootViewController为需要的视图控制器;

      5、修改window主键入口并显示。

代码片段:

 window = UIWindow(frame: UIScreen.main.bounds)
        self.window?.rootViewController = ViewController()
        self.window?.backgroundColor = UIColor.red
        self.window?.makeKeyAndVisible()
        return true

 

相关文章:

  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2021-11-13
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2021-10-06
相关资源
相似解决方案