mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-19 21:06:10 +00:00
Fix URL Sharing
This commit is contained in:
1 parent
2c1c9b5e08
commit
2ee021b64d
1 file changed
+15
-14
@@ -57,21 +57,22 @@ class ShareViewController: NSViewController, ShareExtensionDelegate {
|
|||||||
self.zipFolderAndSetUpIcon()
|
self.zipFolderAndSetUpIcon()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for attachment in attachments {
|
|
||||||
if attachment.hasItemConformingToTypeIdentifier(kUTTypeURL as String) {
|
|
||||||
attachment.loadItem(forTypeIdentifier: kUTTypeURL as String, options: nil) { data, _ in
|
|
||||||
if let urlData = data as? Data,
|
|
||||||
let url = URL(dataRepresentation: urlData, relativeTo: nil, isAbsolute: false)
|
|
||||||
{
|
|
||||||
self.urls.append(url)
|
|
||||||
} else if let url = data as? NSURL {
|
|
||||||
self.urls.append(url as URL)
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.urls.count == attachments.count {
|
let filteredAttachments = attachments.filter { $0.hasItemConformingToTypeIdentifier(kUTTypeURL as String) }
|
||||||
DispatchQueue.main.async {
|
|
||||||
self.zipFolderAndSetUpIcon()
|
for attachment in filteredAttachments {
|
||||||
}
|
attachment.loadItem(forTypeIdentifier: kUTTypeURL as String, options: nil) { data, _ in
|
||||||
|
if let urlData = data as? Data,
|
||||||
|
let url = URL(dataRepresentation: urlData, relativeTo: nil, isAbsolute: false)
|
||||||
|
{
|
||||||
|
self.urls.append(url)
|
||||||
|
} else if let url = data as? NSURL {
|
||||||
|
self.urls.append(url as URL)
|
||||||
|
}
|
||||||
|
|
||||||
|
if self.urls.count == filteredAttachments.count {
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.zipFolderAndSetUpIcon()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user