marinofaggiana 5 years ago
parent
commit
7560f6326e

+ 12 - 6
Nextcloud.xcodeproj/project.pbxproj

@@ -367,7 +367,6 @@
 		F77B0E221D118A16002130FE /* CCManageLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BFCCC11B68C21900548E76 /* CCManageLocation.m */; };
 		F77B0E301D118A16002130FE /* CCHud.m in Sources */ = {isa = PBXBuildFile; fileRef = F7514EDB1C7B1336008F3338 /* CCHud.m */; };
 		F77B0E311D118A16002130FE /* CCExifGeo.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A54C351C6267B500E2C8BF /* CCExifGeo.m */; };
-		F77B0E411D118A16002130FE /* CCSplit.m in Sources */ = {isa = PBXBuildFile; fileRef = F792A77C1BC7C45400C9388E /* CCSplit.m */; };
 		F77B0E4C1D118A16002130FE /* CCDetail.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D0E65F1BC5042E008D989A /* CCDetail.m */; };
 		F77B0E4F1D118A16002130FE /* CCManageAutoUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE42F1BAC0268006C0017 /* CCManageAutoUpload.m */; };
 		F77B0E5F1D118A16002130FE /* CCSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = F7ACE4311BAC0268006C0017 /* CCSettings.m */; };
@@ -553,6 +552,9 @@
 		F7DFB7F0219C5B8000680748 /* NCCreateFormUploadAssets.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7EF219C5B8000680748 /* NCCreateFormUploadAssets.swift */; };
 		F7DFB7F2219C5C0000680748 /* NCCreateFormUploadFileText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7F1219C5C0000680748 /* NCCreateFormUploadFileText.swift */; };
 		F7DFB7F4219C5CA800680748 /* NCCreateFormUploadScanDocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7DFB7F3219C5CA800680748 /* NCCreateFormUploadScanDocument.swift */; };
+		F7E09CE323E3088000FB3E9E /* NCMainRefreshControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E09CE223E3087F00FB3E9E /* NCMainRefreshControl.swift */; };
+		F7E09CE523E3088C00FB3E9E /* NCSplitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E09CE423E3088A00FB3E9E /* NCSplitViewController.swift */; };
+		F7E09CE723E308AD00FB3E9E /* NCMasterNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E09CE623E308AD00FB3E9E /* NCMasterNavigationController.swift */; };
 		F7E0E1DC22327885006B0911 /* NCAudioRecorderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E0E1DB22327885006B0911 /* NCAudioRecorderViewController.swift */; };
 		F7E0E1DE22327DBA006B0911 /* NCAudioRecorderViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7E0E1DD22327DBA006B0911 /* NCAudioRecorderViewController.storyboard */; };
 		F7E4D9C422ED929B003675FD /* NCShareComments.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E4D9C322ED929B003675FD /* NCShareComments.swift */; };
@@ -1143,8 +1145,6 @@
 		F78F74332163757000C2ADAD /* NCTrash.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCTrash.storyboard; sourceTree = "<group>"; };
 		F78F74352163781100C2ADAD /* NCTrash.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTrash.swift; sourceTree = "<group>"; };
 		F790110D21415BF600D7B136 /* NCViewerRichdocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCViewerRichdocument.swift; sourceTree = "<group>"; };
-		F792A77B1BC7C45400C9388E /* CCSplit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSplit.h; sourceTree = "<group>"; };
-		F792A77C1BC7C45400C9388E /* CCSplit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSplit.m; sourceTree = "<group>"; };
 		F7956FC91B4886E60085DEA3 /* CCUploadFromOtherUpp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCUploadFromOtherUpp.h; sourceTree = "<group>"; };
 		F7956FCA1B4886E60085DEA3 /* CCUploadFromOtherUpp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCUploadFromOtherUpp.m; sourceTree = "<group>"; };
 		F7956FCB1B4886E60085DEA3 /* CCUploadFromOtherUpp.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = CCUploadFromOtherUpp.storyboard; sourceTree = "<group>"; };
@@ -1351,6 +1351,9 @@
 		F7DFB7EF219C5B8000680748 /* NCCreateFormUploadAssets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadAssets.swift; sourceTree = "<group>"; };
 		F7DFB7F1219C5C0000680748 /* NCCreateFormUploadFileText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadFileText.swift; sourceTree = "<group>"; };
 		F7DFB7F3219C5CA800680748 /* NCCreateFormUploadScanDocument.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadScanDocument.swift; sourceTree = "<group>"; };
+		F7E09CE223E3087F00FB3E9E /* NCMainRefreshControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCMainRefreshControl.swift; sourceTree = "<group>"; };
+		F7E09CE423E3088A00FB3E9E /* NCSplitViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCSplitViewController.swift; sourceTree = "<group>"; };
+		F7E09CE623E308AD00FB3E9E /* NCMasterNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCMasterNavigationController.swift; sourceTree = "<group>"; };
 		F7E0E1DB22327885006B0911 /* NCAudioRecorderViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCAudioRecorderViewController.swift; sourceTree = "<group>"; };
 		F7E0E1DD22327DBA006B0911 /* NCAudioRecorderViewController.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCAudioRecorderViewController.storyboard; sourceTree = "<group>"; };
 		F7E45E6D21E75BF200579249 /* ja-JP */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "ja-JP"; path = "ja-JP.lproj/Localizable.strings"; sourceTree = "<group>"; };
@@ -1617,9 +1620,10 @@
 				F73F537E1E929C8500F8678D /* CCMore.swift */,
 				F78F6FAE1CC8CCB700F4EA25 /* CCSection.h */,
 				F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */,
-				F792A77B1BC7C45400C9388E /* CCSplit.h */,
-				F792A77C1BC7C45400C9388E /* CCSplit.m */,
 				F7226EDB1EE4089300EBECB1 /* Main.storyboard */,
+				F7E09CE223E3087F00FB3E9E /* NCMainRefreshControl.swift */,
+				F7E09CE623E308AD00FB3E9E /* NCMasterNavigationController.swift */,
+				F7E09CE423E3088A00FB3E9E /* NCSplitViewController.swift */,
 				F7D6650620FF341600BFBA9E /* NCMainCommon.swift */,
 				F7682FDF23C36B0500983A04 /* NCMainTabBar.swift */,
 				F77F5D2C23D5F28100D2B7EB /* NCMainRefreshControl.swift */,
@@ -3472,6 +3476,7 @@
 				F754EECB21772B6100BB1CDF /* DropdownMenu.swift in Sources */,
 				F760F78221F21F61006B1A73 /* PhotoEditor+UITextView.swift in Sources */,
 				F77444F522281649000D5EB0 /* NCGridMediaCell.swift in Sources */,
+				F7E09CE323E3088000FB3E9E /* NCMainRefreshControl.swift in Sources */,
 				F77B0DF41D118A16002130FE /* CCMain.m in Sources */,
 				F7AE00F8230E81CB007ACF8A /* NCBrowserWeb.swift in Sources */,
 				F7E9C41B20F4CA870040CF18 /* CCTransfers.m in Sources */,
@@ -3526,6 +3531,7 @@
 				F750374F1DBFA91A008FB480 /* NSArray+PureLayout.m in Sources */,
 				F77444F8222816D5000D5EB0 /* NCPhotosPickerViewController.swift in Sources */,
 				F77B0E141D118A16002130FE /* CCError.m in Sources */,
+				F7E09CE523E3088C00FB3E9E /* NCSplitViewController.swift in Sources */,
 				F73B4F131F470D9100BBEE4B /* nsUniversalDetector.cpp in Sources */,
 				F769454622E9F1B0000A798A /* NCShareCommon.swift in Sources */,
 				F7B0C1751EE839A30033AC24 /* NCAutoUpload.m in Sources */,
@@ -3588,7 +3594,6 @@
 				F760F78D21F21F61006B1A73 /* Protocols.swift in Sources */,
 				F762CAFF1EACB66200B38484 /* XLFormPickerCell.m in Sources */,
 				F7A321AD1E9E6AD50069AD1B /* CCAdvanced.m in Sources */,
-				F77B0E411D118A16002130FE /* CCSplit.m in Sources */,
 				F73CC0781E813DFF006E3047 /* BKShiftingView.m in Sources */,
 				F7A3218C1E9E42B30069AD1B /* CCMenuAccount.m in Sources */,
 				F77B0E4C1D118A16002130FE /* CCDetail.m in Sources */,
@@ -3685,6 +3690,7 @@
 				F762CAF71EACB66200B38484 /* XLFormBaseCell.m in Sources */,
 				F760F78A21F21F61006B1A73 /* UIImage+Size.swift in Sources */,
 				F70022B31EC4C9100080073F /* OCActivity.m in Sources */,
+				F7E09CE723E308AD00FB3E9E /* NCMasterNavigationController.swift in Sources */,
 				F70022D41EC4C9100080073F /* NSDate+ISO8601.m in Sources */,
 				F762CB151EACB66200B38484 /* XLFormRowNavigationAccessoryView.m in Sources */,
 				F762CB0A1EACB66200B38484 /* XLFormDescriptor.m in Sources */,

+ 3 - 0
iOSClient/AppDelegate.m

@@ -183,6 +183,9 @@ PKPushRegistry *pushRegistry;
         }
     }
 
+    // init home
+    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil userInfo:nil];
+    
     return YES;
 }
 

+ 0 - 34
iOSClient/Main/CCSplit.h

@@ -1,34 +0,0 @@
-//
-//  CCSplit.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 09/10/15.
-//  Copyright (c) 2017 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "CCLogin.h"
-#import "CCDetail.h"
-
-@interface CCSplit : UISplitViewController <UISplitViewControllerDelegate>
-
-@property (nonatomic, strong) NSString *version;
-@property (nonatomic, strong) NSString *build;
-
-@end

+ 0 - 245
iOSClient/Main/CCSplit.m

@@ -1,245 +0,0 @@
- //
-//  CCSplit.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 09/10/15.
-//  Copyright (c) 2017 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCSplit.h"
-#import "AppDelegate.h"
-#import "CCLogin.h"
-#import "NCAutoUpload.h"
-#import "NCBridgeSwift.h"
-
-@interface CCSplit ()
-{
-    AppDelegate *appDelegate;
-    BOOL prevRunningInFullScreen;
-}
-@end
-
-@implementation CCSplit
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Init =====
-#pragma --------------------------------------------------------------------------------------------
-
--  (id)initWithCoder:(NSCoder *)aDecoder
-{
-    if (self = [super initWithCoder:aDecoder])  {
-        prevRunningInFullScreen = YES;
-    }
-    
-    return self;
-}
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-
-    appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-    self.delegate = self;
-    
-    // Display mode SPLIT
-    self.preferredDisplayMode = UISplitViewControllerDisplayModeAllVisible;
-    //self.maximumPrimaryColumnWidth = 400;
-    
-    // Settings TabBar
-    UITabBarController *tabBarController = [self.viewControllers firstObject];
-    [appDelegate createTabBarController:tabBarController];
-    
-    [self inizialize];    
-}
-
-- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
-{
-    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
-
-    // iPhone + (fallthrough res)
-    if (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact && [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone && (UIScreen.mainScreen.nativeBounds.size.height == 2208 || UIScreen.mainScreen.nativeBounds.size.height == 1920)) {
-    
-        // FIX master-detail
-        UITabBarController *tbc = self.viewControllers.firstObject;
-        for (UINavigationController *nvc in tbc.viewControllers) {
-        
-            if ([nvc.topViewController isKindOfClass:[CCDetail class]]) {
-                [nvc popViewControllerAnimated:NO];
-            }
-        }
-    }
-    
-    [coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
-        
-        if (self.view.frame.size.width == ([[UIScreen mainScreen] bounds].size.width*([[UIScreen mainScreen] bounds].size.width<[[UIScreen mainScreen] bounds].size.height))+([[UIScreen mainScreen] bounds].size.height*([[UIScreen mainScreen] bounds].size.width>[[UIScreen mainScreen] bounds].size.height))) {
-            
-            // Portrait
-            
-        } else {
-            
-            // Landscape
-        }
-    }];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== inizialization =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)inizialize
-{
-    //  setting version
-    self.version = [CCUtility setVersion];
-    self.build = [CCUtility setBuild];
-    
-    // init home
-    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"initializeMain" object:nil userInfo:nil];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Split View Controller =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (BOOL)splitViewController:(UISplitViewController *)splitViewController collapseSecondaryViewController:(UIViewController *)secondaryViewController ontoPrimaryViewController:(UIViewController *)primaryViewController
-{
-    return YES;
-}
-
-- (UIViewController *)splitViewController:(UISplitViewController *)splitViewController separateSecondaryViewControllerFromPrimaryViewController:(UIViewController *)primaryViewController
-{
-    if ([primaryViewController isKindOfClass:[UINavigationController class]]) {
-        for (UIViewController *controller in [(UINavigationController *)primaryViewController viewControllers]) {
-            if ([controller isKindOfClass:[UINavigationController class]] && [[(UINavigationController *)controller visibleViewController] isKindOfClass:[CCDetail class]]) {
-                return controller;
-            }
-        }
-    }
-    
-    // No detail view present
-    UINavigationController *secondaryNC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"CCDetailNC"];
-    
-    // Ensure back button is enabled
-    UIViewController *detailViewController = [secondaryNC visibleViewController];
-    
-    detailViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem;
-    detailViewController.navigationItem.leftItemsSupplementBackButton = YES;
-    
-    return secondaryNC;
-}
-
-- (UIViewController *)primaryViewControllerForExpandingSplitViewController:(UISplitViewController *)splitViewController
-{
-    UITabBarController *tbMaster = splitViewController.viewControllers[0];
-    UINavigationController *ncMaster = [tbMaster selectedViewController];
-    
-    //UIViewController *main = [ncMaster.viewControllers firstObject];
-    UIViewController *detail = [ncMaster.viewControllers lastObject];
-    
-    if ([detail isKindOfClass:[CCDetail class]]) {
-        
-        [ncMaster popViewControllerAnimated:NO];
-    }
-    
-    return nil;
-}
-
-// sender = CCMain
-// vc = UINavigationController detail
-- (void)showDetailViewController:(UIViewController *)vc sender:(id)sender
-{
-    UINavigationController *ncDetail = (UINavigationController *)vc;
-    UINavigationController *ncMaster = [self.viewControllers.firstObject selectedViewController];
-
-    if (self.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact) {
-        
-        if ([self.viewControllers.firstObject isKindOfClass:[UITabBarController class]]) {
-                        
-            // Fix : Application tried to present modally an active controller
-            if ([ncMaster isBeingPresented]) {
-                // being presented
-            } else if ([ncMaster isMovingToParentViewController]) {
-                // being pushed
-            } else {
-                [ncMaster pushViewController:ncDetail.topViewController animated:YES];
-            }
-
-            return;
-        }
-    }
-    
-    [super showDetailViewController:vc sender:sender];
-    
-    // display icon "<>"
-    ncDetail.topViewController.navigationItem.leftBarButtonItem = self.displayModeButtonItem;
-}
-
-// OK
-- (void)splitViewController:(UISplitViewController *)svc willChangeToDisplayMode:(UISplitViewControllerDisplayMode)displayMode
-{
-    UIViewController *viewController = [svc.viewControllers lastObject];
-    
-    if ([viewController isKindOfClass:[UINavigationController class]]) {
-        
-        UINavigationController *navigationController = (UINavigationController *)viewController;
-        
-        UIViewController *detail = [navigationController.viewControllers firstObject];
-        
-        if ([detail isKindOfClass:[CCDetail class]]) {
-            
-            [(CCDetail *)detail performSelector:@selector(changeToDisplayMode) withObject:nil afterDelay:0.05];
-        }
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Slide Over - Split View =====
-#pragma --------------------------------------------------------------------------------------------
-
--(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
-{
-    // simply create a property of 'BOOL' type
-    BOOL isRunningInFullScreen = CGRectEqualToRect([UIApplication sharedApplication].delegate.window.frame, [UIApplication sharedApplication].delegate.window.screen.bounds);
-    
-    // detect Dark Mode
-    if (@available(iOS 13.0, *)) {
-        if ([CCUtility getDarkModeDetect]) {
-            if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
-                [CCUtility setDarkMode:YES];
-            } else {
-                [CCUtility setDarkMode:NO];
-            }
-        }
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"changeTheming" object:nil];
-    }
-    
-    prevRunningInFullScreen = isRunningInFullScreen;
-    
-    if (prevRunningInFullScreen == NO) {
-        
-        // FIX master-detail
-        UITabBarController *tbc = self.viewControllers.firstObject;
-        for (UINavigationController *nvc in tbc.viewControllers) {
-            
-            if ([nvc.topViewController isKindOfClass:[CCDetail class]]) {
-                [nvc popViewControllerAnimated:NO];
-            }
-        }
-    }
-}
-
-@end

+ 32 - 8
iOSClient/Main/Main.storyboard

@@ -8,14 +8,14 @@
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
-        <!--Split-->
+        <!--Split View Controller-->
         <scene sceneID="B1o-fj-nYn">
             <objects>
-                <splitViewController id="4IE-mo-rkp" customClass="CCSplit" sceneMemberID="viewController">
+                <splitViewController id="4IE-mo-rkp" customClass="NCSplitViewController" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
                     <extendedEdge key="edgesForExtendedLayout"/>
                     <connections>
                         <segue destination="mtc-lf-PRo" kind="relationship" relationship="detailViewController" id="W5b-lw-8O1"/>
-                        <segue destination="FkP-Lh-8zt" kind="relationship" relationship="masterViewController" id="XFR-ol-usq"/>
+                        <segue destination="k86-ao-8mQ" kind="relationship" relationship="masterViewController" id="JcJ-dS-r1m"/>
                     </connections>
                 </splitViewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="6BR-HM-b4e" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -162,7 +162,7 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <imageView userInteractionEnabled="NO" tag="999" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" preservesSuperviewLayoutMargins="YES" image="logo" translatesAutoresizingMaskIntoConstraints="NO" id="zlU-MP-ZVs">
-                                <rect key="frame" x="95.5" y="369.5" width="223" height="157.5"/>
+                                <rect key="frame" x="-16" y="290.5" width="446" height="315"/>
                             </imageView>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -336,7 +336,9 @@
         <!--NCTrash.storyboard-->
         <scene sceneID="361-ZH-Lss">
             <objects>
-                <viewControllerPlaceholder storyboardIdentifier="NCTrash.storyboard" storyboardName="NCTrash" referencedIdentifier="NCTrash.storyboard" id="WTp-0D-Gpe" sceneMemberID="viewController"/>
+                <viewControllerPlaceholder storyboardIdentifier="NCTrash.storyboard" storyboardName="NCTrash" referencedIdentifier="NCTrash.storyboard" id="WTp-0D-Gpe" sceneMemberID="viewController">
+                    <navigationItem key="navigationItem" id="mjj-Fc-L6W"/>
+                </viewControllerPlaceholder>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="WGZ-c6-AXe" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
             <point key="canvasLocation" x="10870" y="228"/>
@@ -344,7 +346,9 @@
         <!--NCOffline.storyboard-->
         <scene sceneID="mwv-1V-aJg">
             <objects>
-                <viewControllerPlaceholder storyboardIdentifier="NCOnDevice.storyboard" storyboardName="NCOffline" referencedIdentifier="NCOffline.storyboard" id="biz-Qc-WHi" sceneMemberID="viewController"/>
+                <viewControllerPlaceholder storyboardIdentifier="NCOnDevice.storyboard" storyboardName="NCOffline" referencedIdentifier="NCOffline.storyboard" id="biz-Qc-WHi" sceneMemberID="viewController">
+                    <navigationItem key="navigationItem" id="rfB-6v-cRv"/>
+                </viewControllerPlaceholder>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="d9n-lT-FK4" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
             <point key="canvasLocation" x="10876" y="327"/>
@@ -352,7 +356,9 @@
         <!--NCActivity.storyboard-->
         <scene sceneID="NqQ-oK-JeC">
             <objects>
-                <viewControllerPlaceholder storyboardName="NCActivity" referencedIdentifier="NCActivity.storyboard" id="2JP-H5-EI3" sceneMemberID="viewController"/>
+                <viewControllerPlaceholder storyboardName="NCActivity" referencedIdentifier="NCActivity.storyboard" id="2JP-H5-EI3" sceneMemberID="viewController">
+                    <navigationItem key="navigationItem" id="2tm-Tj-UzB"/>
+                </viewControllerPlaceholder>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="rXq-Ww-4Zx" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
             <point key="canvasLocation" x="10879" y="424"/>
@@ -378,6 +384,7 @@
                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <viewLayoutGuide key="safeArea" id="jsN-hz-vF5"/>
                     </view>
+                    <navigationItem key="navigationItem" id="aV2-3j-vnZ"/>
                     <connections>
                         <outlet property="tableView" destination="pnc-dQ-cNG" id="YDD-pc-NFL"/>
                     </connections>
@@ -407,6 +414,7 @@
                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <viewLayoutGuide key="safeArea" id="2pW-5T-ywS"/>
                     </view>
+                    <navigationItem key="navigationItem" id="Xn3-AA-DIm"/>
                     <connections>
                         <outlet property="tableView" destination="UXi-wu-3m5" id="msO-8g-crr"/>
                     </connections>
@@ -618,6 +626,22 @@
             </objects>
             <point key="canvasLocation" x="9212" y="1216.9950738916257"/>
         </scene>
+        <!--Master-->
+        <scene sceneID="vvl-da-xtI">
+            <objects>
+                <navigationController title="Master" id="k86-ao-8mQ" customClass="NCMasterNavigationController" customModule="Nextcloud" customModuleProvider="target" sceneMemberID="viewController">
+                    <navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translucent="NO" id="yOS-hc-yM4" customClass="NC">
+                        <rect key="frame" x="0.0" y="44" width="414" height="44"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </navigationBar>
+                    <connections>
+                        <segue destination="FkP-Lh-8zt" kind="relationship" relationship="rootViewController" id="X0W-jo-GrL"/>
+                    </connections>
+                </navigationController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="Uq6-72-639" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="5670" y="-709"/>
+        </scene>
     </scenes>
     <resources>
         <image name="avatar" width="25" height="25"/>
@@ -626,6 +650,6 @@
         <image name="tabBarPlus" width="80" height="80"/>
     </resources>
     <inferredMetricsTieBreakers>
-        <segue reference="2Qm-A6-CfB"/>
+        <segue reference="W5b-lw-8O1"/>
     </inferredMetricsTieBreakers>
 </document>

+ 58 - 0
iOSClient/Main/NCMasterNavigationController.swift

@@ -0,0 +1,58 @@
+//
+//  NCMasterNavigationController.swift
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 30/01/2020.
+//  Copyright © 2020 Marino Faggiana. All rights reserved.
+//
+//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+import Foundation
+
+class NCMasterNavigationController: UINavigationController {
+    
+    let appDelegate = UIApplication.shared.delegate as! AppDelegate
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        self.delegate = self
+        
+        NotificationCenter.default.addObserver(self, selector: #selector(self.changeTheming), name: NSNotification.Name(rawValue: "changeTheming"), object: nil)
+        changeTheming()
+    }
+
+    @objc func changeTheming() {
+        navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
+        navigationBar.tintColor = NCBrandColor.sharedInstance.brandText
+    }
+}
+
+extension NCMasterNavigationController: UINavigationControllerDelegate {
+
+    func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
+                
+        if self.splitViewController?.isCollapsed == true {
+            if (topViewController as? UITabBarController) != nil {
+                self.isNavigationBarHidden = true
+            } else {
+                self.isNavigationBarHidden = false
+            }
+        } else {
+            self.isNavigationBarHidden = true
+        }
+    }
+}

+ 61 - 0
iOSClient/Main/NCSplitViewController.swift

@@ -0,0 +1,61 @@
+//
+//  NCSplitViewController.swift
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 30/01/2020.
+//  Copyright © 2020 Marino Faggiana. All rights reserved.
+//
+//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+import UIKit
+
+class NCSplitViewController: UISplitViewController {
+    
+    let appDelegate = UIApplication.shared.delegate as! AppDelegate
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        
+        self.delegate = self
+        self.preferredDisplayMode = .allVisible
+        
+        let navigationController = viewControllers.first as? UINavigationController
+        if let tabBarController = navigationController?.topViewController as? UITabBarController {
+            appDelegate.createTabBarController(tabBarController)
+        }
+    }
+
+    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
+        if #available(iOS 13.0, *) {
+            if CCUtility.getDarkModeDetect() {
+                if traitCollection.userInterfaceStyle == .dark {
+                    CCUtility.setDarkMode(true)
+                } else {
+                    CCUtility.setDarkMode(false)
+                }
+                NotificationCenter.default.post(name: Notification.Name.init(rawValue: "changeTheming"), object: nil)
+            }
+        }
+    }
+}
+
+extension NCSplitViewController: UISplitViewControllerDelegate {
+    
+    func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController: UIViewController, onto primaryViewController: UIViewController) -> Bool {
+        return true
+    }
+}

+ 0 - 1
iOSClient/Nextcloud-Bridging-Header.h

@@ -26,4 +26,3 @@
 #import "NCRichDocumentTemplate.h"
 #import "HCFeatures.h"
 #import "NCComments.h"
-#import "CCSplit.h"