When utilizing SVG information in SwiftUI for iOS, the Picture("myicon.svg") view works, however you possibly can’t scale the picture easily as a result of they rasterize the SVG after which resize. Right here is an instance:
struct ContentView: View {
@State non-public var svgImage: UIImage?
var physique: some View {
VStack {
Picture("globify-logo")
.resizable()
.body(width: 40, peak: 40)
Picture("globify-logo")
.resizable()
.body(width: 60, peak: 60)
Picture("globify-logo")
.resizable()
.body(width: 80, peak: 80)
}
}
}
… produces resized SVGs that have been already transformed to rasterized pictures after which scaled, which seems to be horrible (see attachment). The entire level of SVGs is scaling. ![iOS SVG information do not measurement accurately, examples are all incorrect [duplicate] iOS SVG information do not measurement accurately, examples are all incorrect [duplicate]](https://i.sstatic.net/Lxz2todr.png)
Word: I do know you possibly can inform it populate all sizes with rasterized pictures, however that’s typically overkill, and takes up numerous area.

