MwxBody
public struct MwxBody<Content> : View where Content : View
A type-erased View
.
An MwxBody
allows changing the type of view used in
a given view hierarchy. Whenever the type of view used with
an MwxBody
changes, the old hierarchy is destroyed and
a new hierarchy is created for the new type use to wrap up
a coordinated view.
-
Represents a value with a view modifier applied to it.
When you create a custom body, Swift infers this type from the generic
Content
type property.Declaration
Swift
public let content: Content
-
Creates an instance of this view. Required.
Declaration
Swift
public init(@ViewBuilder content: () -> Content)
Parameters
content
A closure returning the content of the view.
-
Declares the content and behavior of this view.
When you create a custom view, Swift infers this type from your implementation of the required
body
property.Declaration
Swift
public var body: some View { get }
-
Applies a modifier style to a body view.
Declaration
Swift
func bodyStyle<Style>(_ style: Style) -> some View where Style : ViewModifier
Parameters
style
A
ViewModifier
of the applied body style.Return Value
The styled body view.