App Extensions Overview
Understand share, action, and other extensions.
What App Extensions Are
An app extension lets your app provide functionality inside other apps or system surfaces — sharing content, custom keyboards, Spotlight indexing, and more. Each extension is a separate target with its own lifecycle, sandbox, and entry point defined by the system.
// Extensions run in their own process, launched
// by the host (Photos, Safari, Messages, the system),
// not by your main app.Host, Container, and Sandbox
Three players: the host app invokes the extension, your container app ships it, and the extension itself runs sandboxed. The extension cannot freely talk to your app — they communicate through an App Group, never direct memory access.
import Foundation
// Container app + Extension target share data via
// an App Group, e.g. group.com.example.app
let group = "group.com.example.app"
_ = groupAll lessons in this course
- Building a WidgetKit Widget
- Timeline Providers and Snapshots
- App Extensions Overview
- App Intents and Shortcuts