Closed aashish-nagar-spok closed 4 years ago
func loadNewSVG(fromURL url: URL) { let text = try String(contentsOf: url) // ... <svg width="34px" height="34px" viewBox="0 0 34 34" .... let node = try SVGParser.parse(text: text) svgView.node = node }
Strongly not recommended using method String(contensOf:) especially on main thread, better - use URSSession approach or popular network services like Moya, Alamofire etc. Convert Data to string and parse