[TIL / 25.03.24] UIKit No Storyboard 초기 세팅

2025. 3. 24. 23:56·iOS/Swift

스토리보드 없이 코드 베이스로 UI를 구현하게 된다면 어떻게 세팅할지 알아보자 !

 

1. main.storyboard 삭제

move to trash 해줘야함 !

 

2. 프로젝트 설정 - Build Settings - main 검색하면 나오는 UIKit Main storyboard File Base Name 백스페이스로 제거

 

3. 파일 중 Info.plist에서 해당 항목도 백스페이스로 제거

 

4. SceneDelegate 내에 코드 수정

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        guard let windowScene = (scene as? UIWindowScene) else { return }
        
        window = UIWindow(windowScene: windowScene)
        window?.backgroundColor = .systemBackground
        window?.rootViewController = ViewController()
        window?.makeKeyAndVisible()
    }

 

루트 뷰 컨트롤러는 상황에 맞춰 따로 설정해주면 된다.

 

5. 개발 시작

 

사실 SceneDelegate에서도 설정해주는 방식도 있지만 기억상 SceneDelegate를 지우고 AppDelegate에서도 설정해줬던 기억이 있는데, SceneDelegate 기준으로 작성한다.

'iOS > Swift' 카테고리의 다른 글

[TIL / 25.03.27] HarryPotterBooks 과제 2~4Lv 구현 및 회고  (1) 2025.03.27
HarryPotterBooks 과제 1레벨 기록  (0) 2025.03.25
[TIL / 25.03.20] 최적화(OptimizationTips) 2  (0) 2025.03.20
[TIL / 25.03.19] playground, command line tool에서의 비동기 함수 (feat. escaping closure)  (2) 2025.03.19
[TIL / 25.03.18] 최적화(OptimizationTips) 1  (5) 2025.03.18
'iOS/Swift' 카테고리의 다른 글
  • [TIL / 25.03.27] HarryPotterBooks 과제 2~4Lv 구현 및 회고
  • HarryPotterBooks 과제 1레벨 기록
  • [TIL / 25.03.20] 최적화(OptimizationTips) 2
  • [TIL / 25.03.19] playground, command line tool에서의 비동기 함수 (feat. escaping closure)
subkyu-ios
subkyu-ios
subkyu-ios 님의 블로그 입니다.
  • subkyu-ios
    subkyu-ios 님의 블로그
    subkyu-ios
  • 전체
    오늘
    어제
    • 분류 전체보기 (47) N
      • iOS (31) N
        • Swift (31) N
      • 내일배움캠프 (7)
      • Git, Github (3)
      • Algorithm (6)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    알고리즘
    본캠프
    협업
    til
    프로그래머스
    트러블슈팅
    tabman
    github
    회고
    Wil
    TableView
    최적화
    내일배움캠프
    ios
    사전캠프
    KPT
    Swift
    stackview
    UIKit
    algorithm
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
subkyu-ios
[TIL / 25.03.24] UIKit No Storyboard 초기 세팅
상단으로

티스토리툴바