I use it with UIKit and preview
but when I use extension UIView preview, I got this error
Return type of instance method 'showPreview(width:height:)' requires that 'some View' conform to 'UIView'
This is my extension code
#if canImport(SwiftUI) && DEBUGimport SwiftUI
extensionUIView{privatestructPreview:UIViewRepresentable{letview:UIViewfunc makeUIView(context:Context)->UIView{return view
}func updateUIView(_ uiView:UIView, context:Context){}}func showPreview(width:CGFloat, height:CGFloat)->someView{Preview(view:self).previewLayout(.fixed(width: width, height: height)) // error line
}}#endif
I use it with UIKit and preview
but when I use extension UIView preview, I got this error
Return type of instance method 'showPreview(width:height:)' requires that 'some View' conform to 'UIView'
This is my extension code