In WidgetExtension this @State remote image not refresh after downloaded
Code Block struct WebImageView: View { public var imageUrl: String private let placeHolderImage = UIImage(named: "almond-milk") ?? UIImage() @State private var remoteImage: UIImage? var body: some View { Image(uiImage: remoteImage ?? placeHolderImage) .resizable() } private func downloadWebImage() { guard let url = URL(string: imageUrl) else { return } URLSession.shared.dataTask(with: url) {[self] (data, response, error) in if let data = data, let image = UIImage(data: data) { remoteImage = image } else { debugPrint("error: \(String(describing: error))") } }.resume() } }