생성된 프로젝트 만들기
빈 디렉터리 또는 기존 프로젝트의 디렉터리에서 tuist init를 실행하세요:
mise x tuist@latest -- tuist init
tuist init
이 명령은 생성된 프로젝트 만들기 단계나 기존 Xcode 프로젝트 및 워크스페이스 통합 단계를 안내합니다. 설정을 원격 서버에 연결하여 선택적 테스팅, previews, registry와 같은 기능에 액세스할 수 있도록 도와줍니다.
개발자 경험을 개선하고 cache의 이점을 활용하기 위해 기존 프로젝트를 생성된 프로젝트로 마이그레이션하려면 migration guide를 확인하세요.
종속성 추가#
프로젝트가 추가 기능을 제공하기 위해 서드파티 라이브러리에 의존하는 것은 일반적입니다. 이렇게 하려면 다음 명령을 실행하여 프로젝트를 편집할 때 최상의 환경을 경험하세요:
tuist edit
프로젝트 파일이 포함된 Xcode 프로젝트가 열립니다. Tuist/Package.swift를 편집하고 Kingfisher를 추가하세요:
// swift-tools-version: 5.9
import PackageDescription
#if TUIST
import ProjectDescription
let packageSettings = PackageSettings(
// Customize the product types for specific package product
// Default is .staticFramework
// productTypes: ["Alamofire": .framework,]
productTypes: [:]
)
#endif
let package = Package(
name: "MyApp",
dependencies: [
// Add your own dependencies here:
// .package(url: "https://github.com/Alamofire/Alamofire", from: "5.0.0"),
// You can read more about dependencies here: https://tuist.dev/en/docs/guides/features/projects/dependencies
.package(url: "https://github.com/onevcat/Kingfisher", .upToNextMajor(from: "7.12.0"))
]
)
그런 다음 프로젝트의 애플리케이션 타겟을 편집하여 Kingfisher를 종속성으로 선언하세요:
import ProjectDescription
let project = Project(
name: "MyApp",
targets: [
.target(
name: "MyApp",
destinations: .iOS,
product: .app,
bundleId: "dev.tuist.MyApp",
infoPlist: .extendingDefault(
with: [
"UILaunchStoryboardName": "LaunchScreen.storyboard",
]
),
buildableFolders: [
"MyApp/Sources",
"MyApp/Resources",
],
dependencies: [
.external(name: "Kingfisher")
]
),
.target(
name: "MyAppTests",
destinations: .iOS,
product: .unitTests,
bundleId: "dev.tuist.MyAppTests",
infoPlist: .default,
sources: ["MyApp/Tests/**"],
resources: [],
dependencies: [.target(name: "MyApp")]
),
]
)
그런 다음 tuist install를 실행하여 Swift Package Manager를 사용해 종속성을 해결하고 가져오세요.
Tuist가 권장하는 종속성 접근 방식은 종속성 해결에만 Swift Package Manager(SPM)를 사용합니다. Tuist는 이후 최대 구성 가능성과 제어를 위해 이를 Xcode 프로젝트와 타겟으로 변환합니다.
프로젝트 시각화#
다음 명령을 실행하여 프로젝트 구조를 시각화할 수 있습니다:
tuist graph
이 명령은 프로젝트 디렉터리에 graph.png 파일을 출력하고 엽니다:

종속성 사용#
tuist generate를 실행하여 Xcode에서 프로젝트를 열고, ContentView.swift 파일에 다음과 같이 변경하세요:
import SwiftUI
import Kingfisher
public struct ContentView: View {
public init() {}
public var body: some View {
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Xcode에서 앱을 실행하면 URL에서 로드된 이미지를 볼 수 있습니다.