Notice
Recent Posts
Recent Comments
Link
«   2024/06   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Archives
Today
Total
관리 메뉴

iOS 개발 노트

🪴스토리보드 제거하기 본문

Xcode

🪴스토리보드 제거하기

Daeyun Kwon 2024. 3. 19. 13:43

 

1. 좌측 네비게이터 영역에서 Main.stroyboard를 선택하고 ⌫ 키입력한다. 팝업되는 창에서 ‘Move to Trash’를 선택하여 삭제해준다.
 
 

 

2. info.plist에서 ‘StoryboardName’ 키를 선택하고 ⌫ 키 입력하여 삭제해준다.
 
 
 
3. 타켓 프로젝트의 Build Settings에서 ‘UIKit Main Stroryboard File Base Name’ 키를 선택하고 ⌫ 키 입력하여 삭제해준다.
 
 

 

4. 마지막으로 SceneDelegate.swift 파일을 열고, willConnectTo 에 rootView를 지정해주는 코드를 넣어주면 끝!
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
        // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
        // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
        guard let scene = (scene as? UIWindowScene) else { return }
        window = UIWindow(windowScene: scene)
        window?.rootViewController = ViewController()
        window?.makeKeyAndVisible()
    }