Created
April 4, 2021 13:43
-
-
Save steipete/f61bb38ddee07a691bff8a4f681d3486 to your computer and use it in GitHub Desktop.
Revisions
-
steipete created this gist
Apr 4, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ .onDrop(of: [.fileURL], isTargeted: nil) { providers in if let loadableProvider = providers.first(where: { $0.canLoadObject(ofClass: URL.self) }) { _ = loadableProvider.loadObject(ofClass: URL.self) { fileURL, _ in if let fileURL = fileURL, fileURL.pathExtension.lowercased() == "zip" { self.logger.info("Dropped \(fileURL.path)") DispatchQueue.main.async { importer.open(zipArchiveURL: fileURL) } } } return true } return false }