Created
June 16, 2020 22:40
-
-
Save wb-softwares/8b15f866ef26b41f22e46caee3b0bb58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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