Zip importing: importFromFile should take a completionHandler

Deletion of the being-imported file should be done in the
completionHandler.

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander
2018-12-12 19:24:12 +05:30
parent 7ef12d93a7
commit af78fa9a1c
2 changed files with 13 additions and 7 deletions
+3 -2
View File
@@ -27,8 +27,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
mainVC?.tunnelsListVC?.importFromFile(url: url)
_ = FileManager.deleteFile(at: url)
mainVC?.tunnelsListVC?.importFromFile(url: url) {
_ = FileManager.deleteFile(at: url)
}
return true
}