[iOS] Tuist 시작하기(UIKit)

Harry Lee·2024년 11월 1일
0
post-thumbnail

Tuist 버전 확인 및 프로젝트 초기화

Tuist 4.26.0 버전 사용

tuist init --platform ios

UIKit 설정

tuist init으로 생성된 프로젝트는 기본 템플릿이 SwiftUI로 되어있어 UIKit으로 변경

  1. Sources 파일 삭제
  2. AppDelegate 및 SceneDelegate을 Sources 폴더에 추가
  3. LaunchScreen.storyboard 파일을 Resources 폴더에 추가

tuist edit 명령어를 통해 infoPlist를 아래와 같이 수정

infoPlist: .extendingDefault(
    with: [
        "UILaunchStoryboardName": "LaunchScreen.storyboard",
        "UIApplicationSceneManifest": [
            "UIApplicationSupportsMultipleScenes": false,
            "UISceneConfigurations": [
                "UIWindowSceneSessionRoleApplication": [
                    [
                        "UISceneConfigurationName": "Default Configuration",
                        "UISceneDelegateClassName": "$(PRODUCT_MODULE_NAME).SceneDelegate"
                    ],
                ]
            ]
        ],
    ]
),

xcode-select가 /Library/Developer/CommandLineTools 경로를 가르키는 경우 tuist edit이 안되어 아래와 같이 xcode-select가 Xcode의 개발자 도구를 가리키도록 설정

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer 

Tuist에서 외부 의존성 관리

SPM을 사용하여 Project.swift 파일에 패키지 정보를 설정

packages: [
    .remote(
        url: "https://github.com/SnapKit/SnapKit.git",
        requirement: .upToNextMajor(from: "5.0.1")
    )
],
targets: [
    .target(
        dependencies: [
            .package(product: "SnapKit"),
        ]
    ),
]

프로젝트 실행

tuist generate

참고
[Tuist] Version 4 / init / edit / generate / 초기설정 / 수정 / 실행
Tuist 로 외부 의존성 관리하기

profile
A keyboard player

0개의 댓글