marinofaggiana před 4 roky
rodič
revize
3b7dfcd3dc

+ 2 - 1
iOSClient/Activity/NCActivity.swift

@@ -67,7 +67,8 @@ class NCActivity: UIViewController, NCEmptyDataSetDelegate {
     
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
-        
+        appDelegate.activeViewController = self
+
         loadDataSource()
     }
     

+ 1 - 1
iOSClient/AppDelegate.swift

@@ -54,7 +54,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     var activeShares: NCShares?
     var activeTransfers: NCTransfers?
     var activeTrash: NCTrash?
-    var activeViewController: UIViewController?
+    @objc var activeViewController: UIViewController?
     var activeViewerVideo: NCViewerVideo?
     
     var listFilesVC: [String:NCFiles] = [:]

+ 2 - 2
iOSClient/FileViewInFolder/NCFileViewInFolder.swift

@@ -41,7 +41,8 @@ class NCFileViewInFolder: NCCollectionViewCommon  {
     }
     
     override func viewWillAppear(_ animated: Bool) {
-                
+        appDelegate.activeViewController = self
+        
         if serverUrl == NCUtilityFileSystem.shared.getHomeServer(urlBase: appDelegate.urlBase, account: appDelegate.account) {
             self.navigationItem.title = NCBrandOptions.shared.brand
         } else {
@@ -49,7 +50,6 @@ class NCFileViewInFolder: NCCollectionViewCommon  {
         }
         
         presentationController?.delegate = self
-        appDelegate.activeViewController = self
         
         (layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: layoutKey, serverUrl: serverUrl)
         gridLayout.itemForLine = CGFloat(itemForLine)

+ 1 - 0
iOSClient/Media/NCMedia.swift

@@ -118,6 +118,7 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
     
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
+        appDelegate.activeViewController = self
         
         // hide nagigation controller
         navigationController?.navigationBar.prefersLargeTitles = true

+ 1 - 0
iOSClient/More/NCMore.swift

@@ -72,6 +72,7 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
 
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
+        appDelegate.activeViewController = self
         
         var item = NCCommunicationExternalSite()
 

+ 1 - 0
iOSClient/Notification/NCNotification.swift

@@ -51,6 +51,7 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, NCEmpty
     
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
+        appDelegate.activeViewController = self
     }
     
     override func viewDidAppear(_ animated: Bool) {

+ 6 - 0
iOSClient/Settings/CCAdvanced.m

@@ -260,6 +260,12 @@
     [self changeTheming];
 }
 
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    appDelegate.activeViewController = self;
+}
+
 - (void)changeTheming
 {
     self.view.backgroundColor = NCBrandColor.shared.backgroundForm;

+ 6 - 0
iOSClient/Settings/CCManageAccount.m

@@ -361,6 +361,12 @@
     [self changeTheming];
 }
 
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    appDelegate.activeViewController = self;
+}
+
 - (void)changeTheming
 {
     self.view.backgroundColor = NCBrandColor.shared.backgroundForm;

+ 2 - 1
iOSClient/Settings/CCManageAutoUpload.m

@@ -213,7 +213,8 @@
 - (void)viewWillAppear:(BOOL)animated
 {
     [super viewWillAppear:animated];
-    
+    appDelegate.activeViewController = self;
+
     // Request permission for camera roll access
     [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
         switch (status) {

+ 5 - 0
iOSClient/Settings/NCManageAutoUploadFileName.swift

@@ -41,6 +41,11 @@ class NCManageAutoUploadFileName: XLFormViewController {
         changeTheming()
     }
     
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        appDelegate.activeViewController = self
+    }
+    
     func reloadForm() {
         
         self.form.delegate = nil

+ 6 - 0
iOSClient/Settings/NCManageEndToEndEncryption.m

@@ -185,6 +185,12 @@
     [self changeTheming];
 }
 
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    appDelegate.activeViewController = self;
+}
+
 - (void)changeTheming
 {
     self.view.backgroundColor = NCBrandColor.shared.backgroundForm;

+ 6 - 0
iOSClient/Settings/NCSettings.m

@@ -189,6 +189,12 @@
     [self changeTheming];
 }
 
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    appDelegate.activeViewController = self;
+}
+
 - (void)changeTheming
 {
     self.view.backgroundColor = NCBrandColor.shared.backgroundForm;

+ 1 - 0
iOSClient/Trash/NCTrash.swift

@@ -95,6 +95,7 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
     
     override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
+        appDelegate.activeViewController = self
         
         self.navigationItem.title = titleCurrentFolder