Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to show a URL image on frontend in SwiftUI

I’m storing my images manually in Firebase with an HTTPS link, but how would I show it on the frontend as an image instead of just the link in String format?

Here’s my code so far:

Vstack{
 Image(skinproduct.image)
       .resizable()
       .aspectRatio(contentMode: .fit)
       .frame(width: 120, height: 120)
}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need to import a package by going to file -> add Packages : and the search for the package called SDWebImageSwiftUI.

You will then need to import the package on the top of your view as:

import SDWebImageSwiftUI

and to call it on the frontend:

WebImage(url: URL(string: skinproduct.image))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading