AnyShape
A type-erased shape value.
Declaration
@frozen struct AnyShapeOverview
You can use this type to dynamically switch between shape types:
struct MyClippedView: View {
var isCircular: Bool
var body: some View {
OtherView().clipShape(isCircular ?
AnyShape(Circle()) : AnyShape(Capsule()))
}
}