The following code, in an independent project works fine:
The following code in a Widget Extension results in an error being displayed in the SwiftUI view (it builds fine):
Code Block struct ContentView: View { var body: some View { List { Text("Hello, world!") } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
The following code in a Widget Extension results in an error being displayed in the SwiftUI view (it builds fine):
Code Block struct ContentView: View { var body: some View { List { Text("Hello, World!") } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() .previewContext(WidgetPreviewContext(family: .systemMedium)) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView().previewContext(WidgetPreviewContext(family: .systemMedium)) } }