I have an UIImage
generated from a CanvasView
.
I want to use the featureprintObservationForImage
feature on it. However it seems to take a URL and I am trying to provide a UIImage, how can I get around this?
Here is my code:
//getting image
UIGraphicsBeginImageContextWithOptions(theCanvasView.bounds.size, false, UIScreen.main.scale)
theCanvasView.drawHierarchy(in: theCanvasView.bounds, afterScreenUpdates: true)
let image2 = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
//setting up observation for image
let drawing = featureprintObservationForImage(atURL: Bundle.main.url(image2)!)
I am getting the error on the last line that says:
Cannot convert value of type 'UIImage?' to expected argument type 'String'
Any ideas?