Skip to content

Commit 05ae690

Browse files
committed
Explain ContainerWidget
1 parent 9594a0b commit 05ae690

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/UIKitBackend/Widget.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,13 @@ class WrapperWidget<View: UIView>: BaseViewWidget {
276276
}
277277
}
278278

279+
/// The root class for widgets who are passed their children on initialization.
280+
///
281+
/// If a widget is passed an arbitrary child widget on initialization (as opposed to e.g. ``WrapperWidget``,
282+
/// which has a specific non-widget subview), it must be a view controller. If the widget is
283+
/// a view but the child is a controller, that child will not be connected to the parent view
284+
/// controller (as a view can't know what its controller will be during initialization). This
285+
/// widget handles setting up the responder chain during initialization.
279286
class ContainerWidget: BaseControllerWidget {
280287
let child: any WidgetProtocol
281288

0 commit comments

Comments
 (0)