createWidgetViewController

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!

Data fetching happens automatically - this function handles it internally.

Called from Swift to create the widget view for WidgetKit.

Return

A UIViewController containing the Compose widget, or null if widget not found

Parameters

widgetName

The name of the widget to render

family

The iOS widget family (e.g., "systemSmall", "systemMedium")