프로젝트를 처음 생성하면 기본으로 생기는 Main, LaunchScreen 스토리보드를 모두 삭제 해준다. (삭제 시 항상 Move to trash 선택할 것 잊지 말기)
프로젝트의 targets > build setting의 info.plist values 섹션에서 다음과 같이 두 값을 모두 지워준다. (Launch screen 은 그냥 두기도 하던데 저는 그냥 지웠습니다)
info.plist에 들어가면 storboard name 이라는 프로퍼티가 있는데, 지워준다.
스토리보드로 개발을 하면 화살표 모양으로 앱 실행 시 처음 실행될 페이지를 지정하는 엔트리 포인트를 설정할 수 있다. 그러나 이제 스토리보드를 삭제했으므로, 이 엔트리 포인트를 코드를 통해 설정해주어야 한다. 이 과정은 각 scene들의 lifecycle을 관리하는 SceneDelegate에서 해준다.
SceneDelegate에 들어가면 맨 위에 있는 willConnectTo
메소드 내용을 다음과 같이 수정해준다.
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).
// 사용할 windowScene 인스턴스
guard let windowScene = (scene as? UIWindowScene) else { return }
// 화면을 구성하는 UIWindow
window = UIWindow(windowScene: windowScene)
// 실제 실행 시 처음으로 보여질 뷰컨트롤러
let tabBarController = ViewController()
window?.rootViewController = tabBarController
window?.makeKeyAndVisible()
}
완성!