marinofaggiana 4 years ago
parent
commit
1a04c3b42b

+ 1 - 1
iOSClient/AppDelegate.m

@@ -162,7 +162,7 @@
         }
     }
     
-    //
+    // TabBar Controller
     UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
     if ([tabBarController isKindOfClass:[UITabBarController class]]) {
         [self createTabBarController:tabBarController];

+ 0 - 1
iOSClient/CCGlobal.h

@@ -310,7 +310,6 @@
 #define k_notificationCenter_initializeMain             @"initializeMain"
 #define k_notificationCenter_setTitleMain               @"setTitleMain"
 #define k_notificationCenter_changeTheming              @"changeTheming"
-#define k_notificationCenter_splitViewChangeDisplayMode @"splitViewChangeDisplayMode"
 #define k_notificationCenter_changeUserProfile          @"changeUserProfile"
 #define k_notificationCenter_richdocumentGrabFocus      @"richdocumentGrabFocus"
 #define k_notificationCenter_reloadDataNCShare          @"reloadDataNCShare"

+ 2 - 1
iOSClient/Detail/NCDetailViewController.swift

@@ -58,7 +58,6 @@ class NCDetailViewController: UIViewController {
         super.viewDidLoad()
 
         NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(changeDisplayMode), name: NSNotification.Name(rawValue: k_notificationCenter_splitViewChangeDisplayMode), object: nil)
         
         NotificationCenter.default.addObserver(self, selector: #selector(downloadedFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_downloadedFile), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(uploadedFile(_:)), name: NSNotification.Name(rawValue: k_notificationCenter_uploadedFile), object: nil)
@@ -172,6 +171,7 @@ class NCDetailViewController: UIViewController {
         }
     }
    
+    /*
     @objc func changeDisplayMode() {
        if self.view?.window == nil { return }
         
@@ -181,6 +181,7 @@ class NCDetailViewController: UIViewController {
             self.setProgressBar()
         }
     }
+    */
     
     @objc func triggerProgressTask(_ notification: NSNotification) {
         if self.view?.window == nil { return }

+ 11 - 32
iOSClient/Main/CCMore.swift

@@ -350,23 +350,13 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             self.present(controller, animated: true, completion: nil)
 
         } else if item.url.contains("//") {
+           
+            let browserWebVC = UIStoryboard(name: "NCBrowserWeb", bundle: nil).instantiateInitialViewController() as! NCBrowserWeb
+            browserWebVC.urlBase = item.url
+            browserWebVC.isHiddenButtonExit = true
 
-            if (self.splitViewController?.isCollapsed)! {
-
-                let browserWebVC = UIStoryboard(name: "NCBrowserWeb", bundle: nil).instantiateInitialViewController() as! NCBrowserWeb
-                browserWebVC.urlBase = item.url
-                browserWebVC.isHiddenButtonExit = true
-
-                self.navigationController?.pushViewController(browserWebVC, animated: true)
-                self.navigationController?.navigationBar.isHidden = false
-
-            } else {
-
-                let browserWebVC = UIStoryboard(name: "NCBrowserWeb", bundle: nil).instantiateInitialViewController() as! NCBrowserWeb
-                browserWebVC.urlBase = item.url
-
-                self.present(browserWebVC, animated: true, completion: nil)
-            }
+            self.navigationController?.pushViewController(browserWebVC, animated: true)
+            self.navigationController?.navigationBar.isHidden = false
 
         } else if item.url == "logout" {
 
@@ -395,23 +385,12 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         if (quotaMenu.count > 0) {
 
             let item = quotaMenu[0]
+            let browserWebVC = UIStoryboard(name: "NCBrowserWeb", bundle: nil).instantiateInitialViewController() as! NCBrowserWeb
+            browserWebVC.urlBase = item.url
+            browserWebVC.isHiddenButtonExit = true
 
-            if (self.splitViewController?.isCollapsed)! {
-
-                let browserWebVC = UIStoryboard(name: "NCBrowserWeb", bundle: nil).instantiateInitialViewController() as! NCBrowserWeb
-                browserWebVC.urlBase = item.url
-                browserWebVC.isHiddenButtonExit = true
-
-                self.navigationController?.pushViewController(browserWebVC, animated: true)
-                self.navigationController?.navigationBar.isHidden = false
-
-            } else {
-
-                let browserWebVC = UIStoryboard(name: "NCBrowserWeb", bundle: nil).instantiateInitialViewController() as! NCBrowserWeb
-                browserWebVC.urlBase = item.url
-
-                self.present(browserWebVC, animated: true, completion: nil)
-            }
+            self.navigationController?.pushViewController(browserWebVC, animated: true)
+            self.navigationController?.navigationBar.isHidden = false
         }
     }
 

+ 2 - 4
iOSClient/Main/Menu/AppDelegate+Menu.swift

@@ -66,10 +66,8 @@ extension AppDelegate: NCAudioRecorderViewControllerDelegate {
                 title: NSLocalizedString("_upload_file_", comment: ""),
                 icon: CCGraphics.changeThemingColorImage(UIImage(named: "file"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
                 action: { menuAction in
-                    if let navigationController = (self.window.rootViewController as! UISplitViewController).viewControllers.first as? UINavigationController {
-                        if let tabBarController = navigationController.topViewController as? UITabBarController {
-                            self.documentPickerViewController = NCDocumentPickerViewController.init(tabBarController: tabBarController)
-                        }
+                    if let tabBarController = self.window.rootViewController as? UITabBarController {
+                        self.documentPickerViewController = NCDocumentPickerViewController.init(tabBarController: tabBarController)
                     }
                 }
             )

+ 0 - 5
iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift

@@ -44,7 +44,6 @@ import PDFKit
         super.init(frame: CGRect(x: frame.origin.x, y: frame.origin.y, width: frame.width, height: height))
         
         NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
-        NotificationCenter.default.addObserver(self, selector: #selector(changeDisplayMode), name: NSNotification.Name(rawValue: k_notificationCenter_splitViewChangeDisplayMode), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(searchText), name: NSNotification.Name(rawValue: k_notificationCenter_menuSearchTextPDF), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(handlePageChange), name: Notification.Name.PDFViewPageChanged, object: nil)
     }
@@ -115,10 +114,6 @@ import PDFKit
     
     //MARK: - NotificationCenter
     
-    @objc func changeDisplayMode() {
-        layoutIfNeeded()
-    }
-    
     @objc private func handlePageChange() {
         
         guard let curPage = currentPage?.pageRef?.pageNumber else { pageView.alpha = 0; return }