One Logo Pool Ball
WidgetKit · IOS API REFERENCE

DynamicIsland

struct · iOS 16.1+ · SDK 27.1

struct DynamicIsland

The layout and configuration for a Live Activity that appears in the Dynamic Island.

Members (3)

method · iOS 16.1+

keylineTint

TypeScript
keylineTint(color?: (_SwiftUICore_Color) | null): DynamicIsland
Swift declaration
func keylineTint(_ color: Color?) -> DynamicIsland

Applies a subtle tint color to the surrounding border of a Live Activity that appears in the Dynamic Island. - Parameters: - color: The tint color to use. - Returns: The configuration object for the Dynamic Island with the specified keyline tint color.

method · iOS 16.1+

contentMargins

TypeScript
contentMargins(edges: _SwiftUICore_Edge_Set, length: number, mode: DynamicIslandMode): DynamicIsland
Swift declaration
func contentMargins(_ edges: Edge.Set = .all, _ length: Double, for mode: DynamicIslandMode) -> DynamicIsland

Overrides default content margins for the provided content modes in the Dynamic Island. Use this modifier to customize the content margins for a content mode in the Dynamic Island. Avoid placing content too close to the edges of the Dynamic Island. The following example uses the default margin for the leading edge and sets a custom margin of 8 points for the top, bottom, and trailing edges of a Live Activity in the expanded presentation: ```swift dynamicIsland .contentMargins([.top, .bottom, .trailing], 8, for:.expanded) ``` When you apply multiple `contentMargins(_:_:for:)` modifiers, modifiers with the same placement override modifiers higher up in the view hierarchy. The following example results in a margin of 8 points for the trailing edge and 20 points for all other edges when the Live Activity appears in the expanded presentation: ```swift dynamicIsland .contentMargins(.trailing, 8, for:.expanded) .contentMargins(.all, 20, for:.expanded) ``` - Parameters: - edges: The edges that should use custom content margins. - length: The value for the custom content margin for the specified `edges`. - mode: The presentation of the Dynamic Island that the custom content margins apply to. - Returns: The Dynamic Island view with updated content margins.

method · iOS 16.1+

widgetURL

TypeScript
widgetURL(url?: (string) | null): DynamicIsland
Swift declaration
func widgetURL(_ url: URL?) -> DynamicIsland

Sets the URL that opens the corresponding app of a Live Activity when a user taps on the Live Activity. By setting the URL with this function, it becomes the default URL for deep linking into the app for each view of the Live Activity. However, if you include a <doc://com.apple.documentation/documentation/swiftui/link> in the Live Activity, the link takes priority over the default URL. When a person taps on the `Link`, it takes them to the place in the app that corresponds to the URL of the `Link`. - Parameters: - url: The URL that opens the app. - Returns: The configuration object for the Dynamic Island with the specified URL.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

DynamicIsland.init(expanded:compactLeading:compactTrailing:minimal:)

callback cannot propagate synchronous failure

All WidgetKit types →