Closed ca13ra1 closed 3 years ago
I'm attempting to get SVG's in SwiftUII for WidgetKit but the images won't load in the widget. It works fine in a SwiftUI app. Getting the yellow and red circle with a line through it. Is this at all possible in WidgetKit.
SVG
SwiftUII
WidgetKit
SwiftUI
import SDWebImageSVGCoder import SDWebImageSwiftUI struct SVGImage: UIViewRepresentable { var url: URL func makeUIView(context: Context) -> UIImageView { let SVGCoder = SDImageSVGCoder.shared SDImageCodersManager.shared.addCoder(SVGCoder) let imageView = UIImageView(image: UIImage(systemName: "questionmark")) imageView.sd_setImage(with: url, placeholderImage: UIImage(named: "questionmark")) return imageView } func updateUIView(_ uiView: UIImageView, context: Context) { } }
I'm attempting to get
SVG
's inSwiftUII
forWidgetKit
but the images won't load in the widget. It works fine in aSwiftUI
app. Getting the yellow and red circle with a line through it. Is this at all possible inWidgetKit
.