Sign In
한결
Status
Empty
Assignee
Empty
UIKit - 스토리보드 기반에서 코드 기반으로 시뮬레이터 작업 세팅하기
💡
스토리보드 + 코드 기반에서 코드 기반으로만 iOS 개발 작업을 할 수 있는 세팅 방법을 순서대로 기록합니다.
1. MainStoryboard 파일을 삭제한다.
사실 파일을 삭제할 필요까지는 없지만, 앞으로 사용할 일이 없기 때문에 굳이 남겨둘 이유도 없다.
2.
info.plist 파일에서 Storyboard Name 을 지워준다.
3.
프로젝트 설정 > Build Settings > Info.plist Values 항목에서 스토리보드 항목을 지워준다.
4.
SceneDelegate.swift 파일에서 scene 함수 내부에서 Window 객체에 엔트리로 연결하려고 하는 ViewController 인스턴스를 맵핑해준다.
func scene( _ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let scene = (scene as? UIWindowScene) else { return } window = UIWindow(windowScene: scene) let entryVC = ViewController() window?.rootViewController = entryVC window?.makeKeyAndVisible() }
👍