I'm trying to convert a link to Data but my code is failing with most images. I don't know why it works with some images and not with others.
if provider.hasItemConformingToTypeIdentifier("public.image") {
provider.loadInPlaceFileRepresentation(forTypeIdentifier: "public.image") { image, _, err in
guard let image = image else {return}
do {
DispatchQueue.main.async {
self.parent.image = try? Data(contentsOf: image)
}
}
}
}