LoginSignup
0
1

More than 3 years have passed since last update.

Xcodeプロジェクト作成時にMain.storyboardから脱却する方法

Posted at

環境

Xcode: Version 11.3.1 (11C505)
Swift: 5
iOS: 13.2

手順

  1. アプリ本体とTestのinfo.plistからMain storyboard file base nameの項目を排除する
  2. Main.storyboardを削除する
  3. SceneDelegateに追記する
swift/SceneDelegate.swift

 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
         guard let scene = (scene as? UIWindowScene) else { return }

         window = {
             let window = UIWindow(windowScene: scene)
             window.rootViewController = ViewController()
             window.makeKeyAndVisible()
             return window
         }()
     }

以上

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1