-
[Tuist] tuist 프로젝트에 App Extension 추가하기Tuist 2024. 9. 26. 11:49반응형
App Extension에 관한 프로퍼티에 대해서 얘기를 해볼게요
product 타입에서 appExtension으로 지정해야합니다
NSExtensionPointIdentifier 는 App Extension의 타입을 결정합니다.
이 키는 모든 App Extension에 필요하며, NSExtension 키의 즉각적인 자식으로 배치되어야 합니다.
tuist의 Manifests 파일을 아래 예시코드처럼 작성하게됩니다.
해당 예제는 Share Extension 을 사용했습니다.
(설명에 포함되지않는 속성을 제외되었습니다.)
let project = Project( name: appName, targets: [ ... // app target // ✅의존성 추가 dependencies: [.target(name: "\(appName)ShareExtension")] ), .target( product: .appExtension, infoPlist: .extendingDefault(with: [ "NSExtension" : [ // ⭐️NSExtension의 즉각적인 자식으로 배치 // ⭐️App Extension 타입을 결정 "NSExtensionPointIdentifier": "com.apple.share-services", "NSExtensionPrincipalClass": "$(PRODUCT_MODULE_NAME).ShareViewController", ] ]), ), ] )
다른 extension 타입의 경우 tuist의 sample project 를 참고하면 도움이 될겁니다
https://github.com/tuist/tuist/blob/main/fixtures/ios_app_with_extensions/Project.swift