I have a URL in the form of
foo://?data:application/x-foo;base64,OjAyMDAwMDA0MDAwMEZBDQo6MTAwMDA...
and now need to extract the base64 data into a Data
object.
Unfortunately it seems the Data
object does not support this yet as
let data = try Data(contentsOf: url)
returns NSURLConnection finished with error - code -1002
when trying.
While I could decode the URL manually I am wondering if I am missing a simple standard way of doing this. How would you do this?