carson-katri / swift-request

Declarative HTTP networking, designed for SwiftUI
MIT License
727 stars 41 forks source link

Question: RequestImage support for SVG images? #55

Closed ca13ra1 closed 3 years ago

ca13ra1 commented 3 years ago

Are SVG images supported or could be supported by RequestImage? The API I'm using only allows for SVG unfortunately.

carson-katri commented 3 years ago

SwiftUI's Image doesn't support SVG AFAIK, so no... You may be able to convert the raw SVG data to a Shape/Path, or even a PNG first, but swift-request does not handle that case.

Another option may be to load it into a WKWebView.

ca13ra1 commented 3 years ago

After I was looking into this, I noticed SVG’s weren’t supported. I ended up using a Python script to get all the SVG’s and converted them to PNG’s.