Interactive Controls (iOS)
User interface controls that respond to user interaction in Live Activities.
Button
An interactive button component that triggers in-app events via interaction intents.
Parameters:
buttonStyle(string, optional): Visual style of the button:"automatic"- System-determined style"bordered"- Bordered style"borderedProminent"- Bordered with prominent fill"plain"- Plain style without border"borderless"- Borderless style
Apple Documentation: Button
Availability: iOS 17.0+ (interaction intents)
Usage
Buttons fire interaction events that you can handle in your app:
Handle the event:
Examples
Basic button:
Button with icon:
Link
A navigable link component that opens a URL when tapped. Uses SwiftUI's native Link for semantic navigation.
Parameters:
destination(string, required): URL to navigate to when tapped. Supports both absolute URLs and relative paths.
Apple Documentation: Link
Availability: iOS 14.0+
URL Normalization
Link automatically normalizes URLs using your app's URL scheme:
- Absolute URLs: Used as-is (
"myapp://orders/123","https://example.com") - Relative with
/:"/settings"→"myapp://settings" - Relative without
/:"help"→"myapp://help"
Examples
Link with absolute URL:
Link with relative path:
When to use Link vs Button
Toggle
Toggles a boolean state via an intent. Fires an interaction event when changed.
Parameters:
defaultValue(boolean, optional): Initial toggle state (default:false)
Apple Documentation: Toggle
Availability: iOS 17.0+
Example:
Handle toggle events:
