새소식

인기 검색어

iOS/iOS

[iOS] Xcode Stroyboard 없이 시작하기

  • -

1. 프로젝트 생성

 

2. 스토리보드 삭제

3. Info.plist 에서 Stroyboard Name 삭제

4. 프로젝트 설정 Build Settings에서 Info.plist Values에서 UIKit Main Stroyboard File Base Name 삭제

 

5. SceneDelegate.swift에서 시작 뷰컨트롤러 설정

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)
        
        // 시작할 뷰 컨트롤러 생성
        let vc = ViewController()
        
        // UI윈도우의 루트뷰 설정 및 보여주기
        window?.rootViewController = vc
        window?.makeKeyAndVisible()
    }

    func sceneDidDisconnect(_ scene: UIScene) {
       
    }

    func sceneDidBecomeActive(_ scene: UIScene) {
     
    }

    func sceneWillResignActive(_ scene: UIScene) {
        
    }

    func sceneWillEnterForeground(_ scene: UIScene) {
    
    }

    func sceneDidEnterBackground(_ scene: UIScene) {
      
    }
}

 

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

[iOS] Codable CodingKey  (0) 2023.02.07
[iOS] 커스텀 UITableViewCell 만들기 및 하나의 테이블뷰에 여러개의 셀 보여주기  (0) 2023.02.04
[iOS] UIStackView  (0) 2023.01.23
[iOS] UITextField  (0) 2023.01.23
[iOS] UIButton  (0) 2023.01.23
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.