Given the following code
import SwiftUI struct Foo: View { var body: some View { Text("Hello World") } } let anyViewFoo = AnyView(