Xcode: 스토리보드 없이 코딩하기

2677 단어 iOSXcodeXcode
  1. main.storyboard 제거

  2. Target - General - Deployment Info - Main Interface에서 "Main" 지워주기

  3. Info.plist - 'Storyboard Name' 제거

  4. SceneDelegate(iOS13~): rootViewController지정

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

          window?.windowScene = windowScene
          window?.rootViewController = HomeViewController()
          window?.makeKeyAndVisible()

좋은 웹페이지 즐겨찾기