I have a view in swift(UIKit). I have converted this view to UIViewRepresentable and this I have used in swiftUI and my UIKIt view is visible in it.
This above swiftUI contentView is working fine while showing in the application form. But when I try the same in Widgets, the application is getting crashed.
I am getting the following error :
Fatal error: PlatformViewRepresentableAdaptor<MyViewRepresentable>: file /Library/Caches/com.apple.xbs/Sources/ChronoSim/Chrono-63.5/WidgetKit/SPI/WidgetViewArchive.swift, line 254
2020-07-08 12:45:31.402597+0530 TestSwiftWidgetExtension[24779:632349] Fatal error: PlatformViewRepresentableAdaptor<MyViewRepresentable>: file /Library/Caches/com.apple.xbs/Sources/ChronoSim/Chrono-63.5/WidgetKit/SPI/WidgetViewArchive.swift, line 254
Code Block swift import SwiftUI struct ContentView: View { var body: some View { VStack { Text("Hello, world!").padding() Text("This is root content view") MyViewRepresentable() } } }
This above swiftUI contentView is working fine while showing in the application form. But when I try the same in Widgets, the application is getting crashed.
I am getting the following error :
Fatal error: PlatformViewRepresentableAdaptor<MyViewRepresentable>: file /Library/Caches/com.apple.xbs/Sources/ChronoSim/Chrono-63.5/WidgetKit/SPI/WidgetViewArchive.swift, line 254
2020-07-08 12:45:31.402597+0530 TestSwiftWidgetExtension[24779:632349] Fatal error: PlatformViewRepresentableAdaptor<MyViewRepresentable>: file /Library/Caches/com.apple.xbs/Sources/ChronoSim/Chrono-63.5/WidgetKit/SPI/WidgetViewArchive.swift, line 254