Home iOS 스토리보드 삭제
Post
Cancel

iOS 스토리보드 삭제

스토리보드 삭제

1. Info.plist 수정

스크린샷 2023-02-11 오후 8 02 31

여기서 StoryBoard Name 완전 삭제

2. 프로젝트 수정

스크린샷 2023-02-11 오후 8 06 56

Supports multiple windows 클릭

스크린샷 2023-02-11 오후 8 07 36

Main storyboard file base name에 Value 값 삭제

3. SceneDelegate scene 수정

1
2
3
4
5
6
7
8
9
guard let windowScene = (scene as? UIWindowScene) else { return }
        
        window = UIWindow(frame: UIScreen.main.bounds)
        
        let viewController = ViewController()
        window?.rootViewController = viewController
        
        window?.makeKeyAndVisible()
        window?.windowScene = windowScene

1번 방법

1
2
3
4
5
6
7
8
9
        guard let windowScene = (scene as? UIWindowScene) else { return }

        let window = UIWindow(windowScene: windowScene)

        let viewController = ViewController()
        window.rootViewController = viewController

        window.makeKeyAndVisible()
        self.window = window

2번 방법

4. iOS 13이하 버전 대응

1
2
3
4
5
6
7
8
9
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        if #available(iOS 13.0, *) { 
            return true
        }
        window = UIWindow()
        window?.rootViewController = ViewController() 
        window?.makeKeyAndVisible()
        return true
    }
This post is licensed under CC BY 4.0 by the author.