Composer: Fix sharing an UIImage directly

This commit is contained in:
Thomas Ricouard 2023-02-17 08:33:56 +01:00
parent ea702e1101
commit 59d8346bc8

View file

@ -54,7 +54,9 @@ enum StatusEditorUTTypeSupported: String, CaseIterable {
return transferable
}
if self == .jpeg || self == .png || self == .tiff || self == .image || self == .uiimage {
if let imageURL = result as? URL,
if let image = result as? UIImage {
return image
} else if let imageURL = result as? URL,
let data = try? Data(contentsOf: imageURL),
let image = UIImage(data: data)
{