Live Activities
Five SwiftPieces Pro templates put what's happening right now on the Lock Screen and in the Dynamic Island, in the app's own brand.
Five Pro templates ship a Live Activity: Pulse, Stillwater, Sprig, Atelier and Wayfare. Each one shows on the Lock Screen and in the Dynamic Island in the app's own colours, and starts and ends from the app's own code.
| Template | What it follows | Started by |
|---|---|---|
| Pulse (Fitness) | A session in progress: the phase, the round and its time left, the session bar | PulseLiveActivity.follow, from the running session |
| Stillwater (Meditation) | A breathing session: the breath to take now and the time left | SessionPlayerView |
| Sprig (Meal Planner) | Cook mode: the recipe, the step and its timer, a segment per step | CookModeView, while a step timer runs |
| Atelier (Shop) | An order out for delivery: its stage on a five-step track and when it arrives | AtelierDeliveryActivity.sync |
| Wayfare (Travel) | A trip day: what's next on today's plan and when, with the day's progress | WayfareTripActivity.sync |
Where it lives
- The Live Activity's view is in
Widget/Sources/<App>LiveActivityWidget.swift, next to the template's widgets. - Its attributes and the code that starts, updates and ends it live in the app's shared module, so the app and the extension agree on one type.
- Pulse, Stillwater and Sprig count their timers down on their own, so the app only updates the activity when something changes.
To ship one, keep NSSupportsLiveActivities in the app's Info.plist (the template sets it) and test it on a device or a simulator with a Dynamic Island.