FidgetWidgetBridge

Bridge between Kotlin/Compose and iOS WidgetKit.

This object maintains a registry of widgets and provides functions that can be called from Swift to render widget content as native UIViews.

Functions

Link copied to clipboard
fun createWidgetViewController(widgetName: String, family: String): UIViewController?

Creates a UIViewController that renders the widget using Compose Multiplatform. This provides full interactivity - buttons, gestures, animations all work!

Link copied to clipboard

Get all registered widgets. Called from Swift to enumerate available widgets.

Link copied to clipboard

Get widget configuration by name. Useful for accessing update policies and other metadata from Swift.

Link copied to clipboard
suspend fun getWidgetData(widgetName: String): WidgetData?

Fetches widget data asynchronously. This is a suspend function that Swift can await using async/await.

Link copied to clipboard
fun <T : WidgetData> registerWidget(configuration: WidgetConfig, dataProvider: WidgetDataProvider<T>?, content: @Composable (context: WidgetContext<T>) -> Unit)