I'm trying to manipulate SVG using simple XML codes to add SVG into Xcode using the framework SVGKit.
But I got a fatal error:
Fatal error: Unexpectedly found nil while unwrapping an Optional value: file aiSoccer/DetailViewController.swift, line 86
Here is the code:
let dataSvg = "<svg width=\"100\" height=\"100\"><circle cx=\"50\" cy=\"50\" r=\"40\" stroke=\"green\" stroke-width=\"4\" fill=\"yellow\" /></svg>".data(using: .utf8)
let receivedIcon: SVGKImage = SVGKImage(data: dataSvg) // LINE 86
self.imageView.image = receivedIcon.uiImage
I'm a noob with Xcode/Swift, can you help me?