Skip to content

Instantly share code, notes, and snippets.

@wb-softwares
Created June 16, 2020 22:40
Show Gist options
  • Save wb-softwares/8b15f866ef26b41f22e46caee3b0bb58 to your computer and use it in GitHub Desktop.
Save wb-softwares/8b15f866ef26b41f22e46caee3b0bb58 to your computer and use it in GitHub Desktop.
struct ImageUrlView: View {
@ObservedObject var remoteImageModel: RemoteImageModel
init(url: String?) {
remoteImageModel = RemoteImageModel(imageUrl: imageUrl)
}
var body: some View {
Image(uiImage: remoteImageModel.image ?? UIImage(named: "default-image-here")!)
.resizable()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment