[iOS][UIKit] Storyboard 없이 code base로 시작하기

이자민·2024년 2월 26일

iOS

목록 보기
1/10

맨날 까먹는 Storyboard없이 codebase로 초기 설정하기!

1️⃣ Main.storyboard 삭제하기

2️⃣ TARGETS Main 삭제하기

1. TARGETS
2. Build Settings
3. "main" 검색
4. "main" 삭제

3️⃣ Info.plist Storyboard Name 삭제하기

1. Info.plist
2. 토글 목록 계속 열기
3. Storyboard Name - 눌러서 삭제하기

4️⃣ SceneDelegate.swift 코드 수정하기

import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

    var window: UIWindow?

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {

        guard let windowScene = (scene as? UIWindowScene) else { return }
            
        window = UIWindow(windowScene: windowScene)
        window?.rootViewController = ViewController()
        window?.makeKeyAndVisible()

    }

}

0개의 댓글