원클릭으로
share-extension
Share extension: NSExtensionActivationRule, data handling, UI. Use when implementing app features related to share extensions.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Share extension: NSExtensionActivationRule, data handling, UI. Use when implementing app features related to share extensions.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
App Clip implementation: separate target, associated domains, URL handling, size limits. Use when implementing app features related to app clips.
Live Activities: ActivityKit, Dynamic Island, Lock Screen widgets, push updates. Use when implementing app features related to live activities.
Safari web extension: content scripts, background scripts, native messaging. Use when implementing app features related to safari extensions.
SpriteKit 2D game development: SpriteView integration, scene architecture, entity-component system, physics, game loop. Use when building 2D games.
Post-build visual UI/UX review: capture simulator screenshots, evaluate with vision, collect findings, fix issues sequentially. Use after successful builds to ensure visual quality.
Handle user-pasted images: install as app icons, add to asset catalogs as named image sets, or use as design references. Use when the user attaches images.
| name | share-extension |
| description | Share extension: NSExtensionActivationRule, data handling, UI. Use when implementing app features related to share extensions. |
| tags | swiftui, ios, extensions |
| platforms | ios |
SHARE EXTENSION: SETUP: Requires separate extension target (kind: "share" in plan extensions array). The extension receives shared content (URLs, text, images) from other apps via the share sheet.
PRINCIPAL CLASS (in extension target): class ShareViewController: SLComposeServiceViewController { override func isContentValid() -> Bool { return contentText.count > 0 // Validate before enabling Post button }
override func didSelectPost() {
// Access shared items
guard let item = extensionContext?.inputItems.first as? NSExtensionItem,
let provider = item.attachments?.first else {
extensionContext?.completeRequest(returningItems: [], completionHandler: nil)
return
}
if provider.hasItemConformingToTypeIdentifier("public.url") {
provider.loadItem(forTypeIdentifier: "public.url") { [weak self] url, _ in
// Handle URL
self?.extensionContext?.completeRequest(returningItems: [], completionHandler: nil)
}
}
}
override func configurationItems() -> [Any]! {
return [] // Return SLComposeSheetConfigurationItem array for optional UI
}
}
INFO.PLIST KEYS (in extension's Info.plist via XcodeGen): NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).ShareViewController NSExtensionActivationRule: NSExtensionActivationSupportsWebURLWithMaxCount: 1 NSExtensionActivationSupportsText: true
APP GROUP: Use AppGroup entitlement to share data between main app and extension.
SHARE EXTENSION: SETUP: Requires separate extension target (kind: "share" in plan extensions array). The extension receives shared content (URLs, text, images) from other apps via the share sheet.
PRINCIPAL CLASS (in extension target): class ShareViewController: SLComposeServiceViewController { override func isContentValid() -> Bool { return contentText.count > 0 // Validate before enabling Post button }
override func didSelectPost() {
// Access shared items
guard let item = extensionContext?.inputItems.first as? NSExtensionItem,
let provider = item.attachments?.first else {
extensionContext?.completeRequest(returningItems: [], completionHandler: nil)
return
}
if provider.hasItemConformingToTypeIdentifier("public.url") {
provider.loadItem(forTypeIdentifier: "public.url") { [weak self] url, _ in
// Handle URL
self?.extensionContext?.completeRequest(returningItems: [], completionHandler: nil)
}
}
}
override func configurationItems() -> [Any]! {
return [] // Return SLComposeSheetConfigurationItem array for optional UI
}
}
INFO.PLIST KEYS (in extension's Info.plist via XcodeGen): NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).ShareViewController NSExtensionActivationRule: NSExtensionActivationSupportsWebURLWithMaxCount: 1 NSExtensionActivationSupportsText: true
APP GROUP: Use AppGroup entitlement to share data between main app and extension.