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
Nevertype indicates that this view doesn’t define its subviews via thebodyproperty.Declaration
Swift
public typealias Body = Never -
Instantiates an
AnyViewby wrappingcontent.Declaration
Swift
public init<Content>(content: Content) where Content : View -
Instantiates an
AnyViewby wrappingcontent.Declaration
Swift
public init(content: TypeErasedView) -
Declaration
Swift
public func customMap<T>(_ transform: (TypeErasedView) -> T) -> [T]
View on GitHub
AnyView Structure Reference