AnyView
public struct AnyView : View, CustomMappable
A type-erased View
.
An AnyView allows changing the type of view used in a given view hierarchy.
-
The
Never
type indicates that this view doesn’t define its subviews via thebody
property.Declaration
Swift
public typealias Body = Never
-
Instantiates an
AnyView
by wrappingcontent
.Declaration
Swift
public init<Content>(content: Content) where Content : View
-
Instantiates an
AnyView
by wrappingcontent
.Declaration
Swift
public init(content: TypeErasedView)
-
Declaration
Swift
public func customMap<T>(_ transform: (TypeErasedView) -> T) -> [T]