mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-09-03 16:33:48 +00:00
Fix warning
This commit is contained in:
parent
870483a962
commit
b3df445d90
1 changed files with 12 additions and 8 deletions
|
@ -18,16 +18,20 @@ extension StatusEditor {
|
|||
} else if let transferable = await getImageTansferable(item: item) {
|
||||
return transferable
|
||||
} else {
|
||||
let result = try await item.loadItem(forTypeIdentifier: value)
|
||||
if let url = result as? URL {
|
||||
return url.absoluteString
|
||||
} else if let text = result as? String {
|
||||
return text
|
||||
} else if let image = result as? UIImage {
|
||||
return image
|
||||
return await withCheckedContinuation { continuation in
|
||||
item.loadItem(forTypeIdentifier: value) { result, error in
|
||||
if let url = result as? URL {
|
||||
continuation.resume(returning: url.absoluteString)
|
||||
} else if let text = result as? String {
|
||||
continuation.resume(returning: text)
|
||||
} else if let image = result as? UIImage {
|
||||
continuation.resume(returning: image)
|
||||
} else {
|
||||
continuation.resume(returning: nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
private func getVideoTransferable(item: NSItemProvider) async -> MovieFileTranseferable? {
|
||||
|
|
Loading…
Reference in a new issue