1. UIKit를 사용하는 새 프로젝트 생성
2. Main.storyboard 파일 삭제
3. info.plist 내 Storyboard Name 제거

4. 프로젝트 Target 내 Build Setting 중 UIKit Main Storyboard File Base Name 제거

5. SceneDelegate.swift 파일 내 willConnectTo 메소드 내용 수정
* UINavigationController(rootViewController: MainViewController()) 중 'MainViewController'는 처음 시작할 ViewController명으로 지정
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 = UINavigationController(rootViewController: MainViewController())
window?.backgroundColor = .white
window?.makeKeyAndVisible()
}
}
'iOS > UIKit' 카테고리의 다른 글
[Storyboard] 실행 시 검은 화면만 나오는 경우 (0) | 2025.02.06 |
---|---|
[iOS] "SDK does not contain 'libarclite' ..." 트러블 슈팅 (0) | 2024.03.07 |
[iOS] Code-Base로 UIStackView 사용하기 (0) | 2023.10.18 |
[iOS] Storyboard로 커스텀 Cell을 가진 CollectionView 만들기 (0) | 2023.10.12 |
[Storyboard] 커스텀 Cell을 가진 TableView 만들기 (0) | 2023.10.11 |