Add doc comment to the ViewDeferredToRenderer protocol (#144)

* Add doc comment to the ViewDeferredToRenderer protocol

* Fix formatting
This commit is contained in:
Max Desiatov 2020-07-02 14:41:05 +01:00 committed by GitHub
parent 525cefe6bc
commit 878c42335e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,11 @@ public protocol ParentView {
/// A `View` type that is not rendered, but "flattened" rendering all its children instead.
protocol GroupView: ParentView {}
/** The distinction between "host" (truly primitive) and "composite" (that have meaningful `body`)
views is made in the reconciler in `TokamakCore` based on their `body` type, host views have body
type `Never`. `ViewDeferredToRenderer` allows renderers to override that per-platform and render
host views as composite by providing their own `deferredBody` implementation.
*/
public protocol ViewDeferredToRenderer {
var deferredBody: AnyView { get }
}