Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarinofaggiana <marino@marinofaggiana.com>2020-10-02 12:01:48 +0300
committermarinofaggiana <marino@marinofaggiana.com>2020-10-02 12:01:48 +0300
commit18a641fd3a9b815b0f8a90ebb8b412f0a72316a0 (patch)
tree45fbf2e0d3ac73609e1c7c90d3705e30aadf9451 /iOSClient
parent2015876c566258f8e88d7e1826c6451187778826 (diff)
coding
Diffstat (limited to 'iOSClient')
-rw-r--r--iOSClient/AppDelegate.m9
-rw-r--r--iOSClient/FileViewInFolder/NCFileViewInFolder.swift11
-rw-r--r--iOSClient/Main/NCCollectionCommon.swift2
3 files changed, 21 insertions, 1 deletions
diff --git a/iOSClient/AppDelegate.m b/iOSClient/AppDelegate.m
index 6f7d6d206..98e11a44b 100644
--- a/iOSClient/AppDelegate.m
+++ b/iOSClient/AppDelegate.m
@@ -200,7 +200,14 @@
// Test Maintenance
if (self.account.length == 0 || self.maintenanceMode)
return;
-
+
+ // Dismiss FileViewInFolder
+ if (self.activeFileViewInFolder != nil ) {
+ [self.activeFileViewInFolder dismissViewControllerAnimated:false completion:^{
+ self.activeFileViewInFolder = nil;
+ }];
+ }
+
[self updateApplicationIconBadgeNumber];
}
diff --git a/iOSClient/FileViewInFolder/NCFileViewInFolder.swift b/iOSClient/FileViewInFolder/NCFileViewInFolder.swift
index d386e0860..312b2c606 100644
--- a/iOSClient/FileViewInFolder/NCFileViewInFolder.swift
+++ b/iOSClient/FileViewInFolder/NCFileViewInFolder.swift
@@ -47,6 +47,7 @@ class NCFileViewInFolder: NCCollectionViewCommon {
self.navigationItem.title = CCUtility.getLastPath(fromServerUrl: serverUrl, urlBase: appDelegate.urlBase)
}
+ presentationController?.delegate = self
appDelegate.activeViewController = self
(layout, _, _, groupBy, _, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: layoutKey, serverUrl: serverUrl)
@@ -62,11 +63,15 @@ class NCFileViewInFolder: NCCollectionViewCommon {
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_close_", comment: ""), style: .plain, target: self, action: #selector(tapClose(sender:)))
}
+ // MARK: - NotificationCenter
+
override func reloadDataSource(_ notification: NSNotification) {
if self.view?.window == nil { return }
reloadDataSource()
}
+ // MARK: - TAP EVENT
+
@objc func tapClose(sender: Any) {
dismiss(animated: true) {
self.appDelegate.activeFileViewInFolder = nil
@@ -145,3 +150,9 @@ class NCFileViewInFolder: NCCollectionViewCommon {
}
}
+extension NCFileViewInFolder: UIAdaptivePresentationControllerDelegate {
+ public func presentationControllerDidDismiss( _ presentationController: UIPresentationController) {
+ self.appDelegate.activeFileViewInFolder = nil
+ }
+}
+
diff --git a/iOSClient/Main/NCCollectionCommon.swift b/iOSClient/Main/NCCollectionCommon.swift
index fb9c956d8..024590770 100644
--- a/iOSClient/Main/NCCollectionCommon.swift
+++ b/iOSClient/Main/NCCollectionCommon.swift
@@ -132,6 +132,8 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
viewController.serverUrl = serverUrl
viewController.fileName = fileName
+
+ navigationController.presentationController?.delegate = viewController
appDelegate.window.rootViewController?.present(navigationController, animated: true, completion: nil)
}