How to use dynamic shape in SwiftUI
Issue #850 Erase with AnyShape struct AnyShape: Shape { init<S: Shape>(_ wrapped: S) { innerPath = { rect in let path = wrapped.path(in: rect) return path } } func path(in rect: CGRect) -> Path { return innerPath(rect) } private let innerPath: (CGRect) -> Path } extension Shape { func erase() -> AnyShape { AnyShape(self) } } Then we can use like private struct ContentView: View { var body: some View { ZStack { Color....