mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-12 03:21:09 +00:00
iOS: Add ability to save photos to gallery
This commit is contained in:
1 parent
5e62f3e107
commit
394aaa8093
11 files changed
+3038
-22
No files matched your search
@@ -42,6 +42,42 @@ final class ProgressAlert {
|
||||
vc.present(alert, animated: true)
|
||||
}
|
||||
|
||||
|
||||
func presentIncomingTransferDoneAlert(
|
||||
title: String,
|
||||
message: String,
|
||||
onImportToPhotos: (() -> Void)? = nil,
|
||||
onDone: (() -> Void)? = nil
|
||||
) {
|
||||
guard let vc = topMostViewController() else { return }
|
||||
|
||||
let alert = UIAlertController(
|
||||
title: title,
|
||||
message: message,
|
||||
preferredStyle: .alert
|
||||
)
|
||||
|
||||
// "Show in Files"
|
||||
alert.addAction(UIAlertAction(title: "BrowseDownloadedFiles".localized(), style: .default) { _ in
|
||||
FileManager.default.openDocumentFolder()
|
||||
})
|
||||
|
||||
// Optional "Import to Photos"
|
||||
if let importHandler = onImportToPhotos {
|
||||
alert.addAction(UIAlertAction(title: "ImportToPhotos".localized(), style: .default) { _ in
|
||||
importHandler()
|
||||
})
|
||||
}
|
||||
|
||||
// "Done"
|
||||
alert.addAction(UIAlertAction(title: "Done".localized(), style: .cancel) { _ in
|
||||
onDone?()
|
||||
})
|
||||
|
||||
vc.present(alert, animated: true)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// MARK: - Progress Alert
|
||||
private func showProgressAlert(onCancel: @escaping () -> Void) {
|
||||
|
||||
Reference in new issue
Block a user