ContainerView

@MainActor
public struct ContainerView<Content> : View, Identifiable, Equatable where Content : View

Provides a wrapper for a SwiftUI View, useful for passing Views in models.

  • id

    A unique identifier.

    Declaration

    Swift

    @MainActor
    public var id: UUID
  • The SwiftUI View to contain.

    Declaration

    Swift

    @ViewBuilder
    @MainActor
    public let content: Content
  • An initializer that takes a closure that contains a View.

    Declaration

    Swift

    @MainActor
    public init(@ViewBuilder content: () -> Content)

    Parameters

    content

    The SwiftUI View to contain.

  • An initializer that takes a View directly.

    Declaration

    Swift

    @MainActor
    public init(view: Content)

    Parameters

    view

    The View to contain.

  • Declaration

    Swift

    @MainActor
    public var body: some View { get }
  • Declaration

    Swift

    nonisolated public static func == (lhs: ContainerView<Content>, rhs: ContainerView<Content>) -> Bool