One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

AnyView

struct · iOS 13.0+ · SDK 27.1

@frozen nonisolated struct AnyView

A type-erased view. An `AnyView` allows changing the type of view used in a given view hierarchy. Whenever the type of view used with an `AnyView` changes, the old hierarchy is destroyed and a new hierarchy is created for the new type.

Members (2)

init · iOS 13.0+

init

TypeScript
static initErasing(view: SDKHandle): AnyView
Swift declaration
@export(implementation) nonisolated init<V>(erasing view: V) where V : View
init · iOS 13.0+

init

TypeScript
static init(view: SDKHandle): AnyView
Swift declaration
nonisolated init<V>(_ view: V) where V : View

Create an instance that type-erases `view`.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →