Parcourir la source

Move to iOS 11

marinofaggiana il y a 4 ans
Parent
commit
e7ba5bf9ce

+ 2 - 2
File Provider Extension/FileProviderDomain.swift

@@ -29,7 +29,7 @@ class FileProviderDomain: NSObject {
         return instance
     }()
 
-    @available(iOS 11.0, *) @objc func registerDomain() {
+    @objc func registerDomain() {
         
         NSFileProviderManager.getDomainsWithCompletionHandler { (fileProviderDomain, error) in
             
@@ -70,7 +70,7 @@ class FileProviderDomain: NSObject {
         }
     }
     
-    @available(iOS 11.0, *) @objc func removeAllDomain() {
+    @objc func removeAllDomain() {
         
         NSFileProviderManager.getDomainsWithCompletionHandler { (fileProviderDomain, error) in
             

+ 12 - 12
Nextcloud.xcodeproj/project.pbxproj

@@ -3414,7 +3414,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 42;
+				CURRENT_PROJECT_VERSION = 43;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -3465,7 +3465,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 42;
+				CURRENT_PROJECT_VERSION = 43;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -3508,7 +3508,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/Share.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 42;
+				CURRENT_PROJECT_VERSION = 43;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -3524,7 +3524,7 @@
 				);
 				HEADER_SEARCH_PATHS = "\"Libraries external\"/**";
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/Share.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
 				LIBRARY_SEARCH_PATHS = "\"Libraries external\"/**";
 				MARKETING_VERSION = 3.0.0;
@@ -3552,7 +3552,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/Share.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 42;
+				CURRENT_PROJECT_VERSION = 43;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -3568,7 +3568,7 @@
 				);
 				HEADER_SEARCH_PATHS = "\"Libraries external\"/**";
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/Share.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
 				LIBRARY_SEARCH_PATHS = "\"Libraries external\"/**";
 				MARKETING_VERSION = 3.0.0;
@@ -3602,7 +3602,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 42;
+				CURRENT_PROJECT_VERSION = 43;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -3652,7 +3652,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 42;
+				CURRENT_PROJECT_VERSION = 43;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -3694,7 +3694,7 @@
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/iOSClient.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 42;
+				CURRENT_PROJECT_VERSION = 43;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -3709,7 +3709,7 @@
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
 				HEADER_SEARCH_PATHS = "$(PROJECT_DIR)\"/Libraries external/openssl\"";
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/iOSClient.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
 				LIBRARY_SEARCH_PATHS = "";
 				MARKETING_VERSION = 3.0.0;
@@ -3741,7 +3741,7 @@
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 42;
+				CURRENT_PROJECT_VERSION = 43;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -3755,7 +3755,7 @@
 				GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
 				HEADER_SEARCH_PATHS = "$(PROJECT_DIR)\"/Libraries external/openssl\"";
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/iOSClient.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 10.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
 				LIBRARY_SEARCH_PATHS = "";
 				MARKETING_VERSION = 3.0.0;

+ 3 - 5
iOSClient/AppDelegate.m

@@ -111,10 +111,12 @@
     // [[AVAudioSession sharedInstance] setActive:YES error:nil];
     [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
     
+    /*
     // APPEARANCE: How to hide UINavigationBar 1px bottom line < iOS 11
     [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
     [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
     [UINavigationBar appearance].translucent = NO;
+    */
     
     // ProgressView Detail
     self.progressViewDetail = [[UIProgressView alloc] initWithProgressViewStyle: UIProgressViewStyleBar];
@@ -834,11 +836,7 @@
 {
     UITabBarItem *item;
     NSLayoutConstraint *constraint;
-    CGFloat safeAreaBottom = 0;
-    
-    if (@available(iOS 11, *)) {
-        safeAreaBottom = [UIApplication sharedApplication].delegate.window.safeAreaInsets.bottom;
-    }
+    CGFloat safeAreaBottom = safeAreaBottom = [UIApplication sharedApplication].delegate.window.safeAreaInsets.bottom;
    
     // File
     item = [tabBarController.tabBar.items objectAtIndex: k_tabBarApplicationIndexFile];

+ 9 - 19
iOSClient/Main/CCMain.m

@@ -159,12 +159,10 @@
     
     // Load Rich Workspace
     self.viewRichWorkspace = [[[NSBundle mainBundle] loadNibNamed:@"NCRichWorkspace" owner:self options:nil] firstObject];
-    if (@available(iOS 11, *)) {
-        UITapGestureRecognizer *viewRichWorkspaceTapped = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(viewRichWorkspaceTapAction:)];
-        viewRichWorkspaceTapped.numberOfTapsRequired = 1;
-        viewRichWorkspaceTapped.delegate = self;
-        [self.viewRichWorkspace addGestureRecognizer:viewRichWorkspaceTapped];
-    }
+    UITapGestureRecognizer *viewRichWorkspaceTapped = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(viewRichWorkspaceTapAction:)];
+    viewRichWorkspaceTapped.numberOfTapsRequired = 1;
+    viewRichWorkspaceTapped.delegate = self;
+    [self.viewRichWorkspace addGestureRecognizer:viewRichWorkspaceTapped];
     heightRichWorkspace = UIScreen.mainScreen.bounds.size.height/4 + heightSearchBar;
     self.viewRichWorkspace.textViewTopConstraint.constant = heightSearchBar;
     [self.viewRichWorkspace setFrame:CGRectMake(0, 0, self.tableView.frame.size.width, heightRichWorkspace)];
@@ -424,12 +422,10 @@
     [appDelegate pushNotification];
     
     // Registeration domain File Provider
-    if (@available(iOS 11, *) ) {
-        if (k_fileProvider_domain) {
-            [FileProviderDomain.sharedInstance registerDomain];
-        } else {
-            [FileProviderDomain.sharedInstance removeAllDomain];
-        }        
+    if (k_fileProvider_domain) {
+        [FileProviderDomain.sharedInstance registerDomain];
+    } else {
+        [FileProviderDomain.sharedInstance removeAllDomain];
     }
 }
 
@@ -704,10 +700,6 @@
             [subview removeFromSuperview];
     }
     
-    if (@available(iOS 10, *)) {
-        self.tableView.refreshControl = nil;
-    }
-    
     refreshControl = nil;
 }
 
@@ -1843,9 +1835,7 @@
     CGFloat locationY = [theGestureRecognizer locationInView: self.navigationController.navigationBar].y;
     CGFloat safeAreaTop = 0;
     CGFloat offsetY = 35;
-    if (@available(iOS 11, *)) {
-        safeAreaTop = [UIApplication sharedApplication].delegate.window.safeAreaInsets.top / 2;
-    }
+    safeAreaTop = [UIApplication sharedApplication].delegate.window.safeAreaInsets.top / 2;
     rect.origin.y = locationY + safeAreaTop + offsetY;
     rect.size.height = rect.size.height - locationY - safeAreaTop - offsetY;
     

+ 5 - 7
iOSClient/Main/CCMore.swift

@@ -119,13 +119,11 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         functionMenu.append(item)
         
         // ITEM : Scan
-        if #available(iOS 11.0, *) {
-            item = OCExternalSites.init()
-            item.name = "_scanned_images_"
-            item.icon = "scan"
-            item.url = "openStoryboardScan"
-            functionMenu.append(item)
-        }
+        item = OCExternalSites.init()
+        item.name = "_scanned_images_"
+        item.icon = "scan"
+        item.url = "openStoryboardScan"
+        functionMenu.append(item)
         
         // ITEM : Trash
         let capabilities = NCManageDatabase.sharedInstance.getCapabilites(account: appDelegate.activeAccount)

+ 0 - 2
iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift

@@ -643,8 +643,6 @@ class NCCreateFormUploadScanDocument: XLFormViewController, NCSelectDelegate, NC
     }
 }
 
-@available(iOS 11, *)
-
 class NCCreateScanDocument : NSObject, ImageScannerControllerDelegate {
     
     @objc static let sharedInstance: NCCreateScanDocument = {

+ 20 - 23
iOSClient/Main/Menu/AppDelegate+Menu.swift

@@ -100,17 +100,15 @@ extension AppDelegate {
         } 
         
         #if !targetEnvironment(simulator)
-            if #available(iOS 11.0, *) {
-                actions.append(
-                    NCMenuAction(
-                        title: NSLocalizedString("_scans_document_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "scan"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                            NCCreateScanDocument.sharedInstance.openScannerDocument(viewController: appDelegate.activeMain)
-                        }
-                    )
-                )
-            }
+        actions.append(
+            NCMenuAction(
+                title: NSLocalizedString("_scans_document_", comment: ""),
+                icon: CCGraphics.changeThemingColorImage(UIImage(named: "scan"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
+                action: { menuAction in
+                    NCCreateScanDocument.sharedInstance.openScannerDocument(viewController: appDelegate.activeMain)
+                }
+            )
+        )
         #endif
 
         actions.append(
@@ -132,19 +130,18 @@ extension AppDelegate {
             )
         )
 
-        if #available(iOS 11.0, *) {
-            if let capabilities = NCManageDatabase.sharedInstance.getCapabilites(account: appDelegate.activeAccount) {
-                if (capabilities.versionMajor >= k_nextcloud_version_18_0 && (self.activeMain.richWorkspaceText == nil || self.activeMain.richWorkspaceText.count == 0)) && !isEncrypted {
-                    actions.append(
-                        NCMenuAction(
-                            title: NSLocalizedString("_add_folder_info_", comment: ""),
-                            icon: CCGraphics.changeThemingColorImage(UIImage(named: "addFolderInfo"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                            action: { menuAction in
-                                self.activeMain.createRichWorkspace()
-                            }
-                        )
+        
+        if let capabilities = NCManageDatabase.sharedInstance.getCapabilites(account: appDelegate.activeAccount) {
+            if (capabilities.versionMajor >= k_nextcloud_version_18_0 && (self.activeMain.richWorkspaceText == nil || self.activeMain.richWorkspaceText.count == 0)) && !isEncrypted {
+                actions.append(
+                    NCMenuAction(
+                        title: NSLocalizedString("_add_folder_info_", comment: ""),
+                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "addFolderInfo"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
+                        action: { menuAction in
+                            self.activeMain.createRichWorkspace()
+                        }
                     )
-                }
+                )
             }
         }
         

+ 8 - 10
iOSClient/Main/Menu/NCDetailNavigationController+Menu.swift

@@ -178,17 +178,15 @@ extension NCDetailNavigationController {
         
         // PDF
         
-        if #available(iOS 11.0, *) {
-            if (metadata.typeFile == k_metadataTypeFile_document && metadata.contentType == "application/pdf" ) {
-                actions.append(
-                    NCMenuAction(title: NSLocalizedString("_search_", comment: ""),
-                        icon: CCGraphics.changeThemingColorImage(UIImage(named: "search"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
-                        action: { menuAction in
-                             NotificationCenter.default.post(name: Notification.Name.init(rawValue:k_notificationCenter_menuSearchTextPDF), object: nil)
-                        }
-                    )
+        if (metadata.typeFile == k_metadataTypeFile_document && metadata.contentType == "application/pdf" ) {
+            actions.append(
+                NCMenuAction(title: NSLocalizedString("_search_", comment: ""),
+                    icon: CCGraphics.changeThemingColorImage(UIImage(named: "search"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon),
+                    action: { menuAction in
+                        NotificationCenter.default.post(name: Notification.Name.init(rawValue:k_notificationCenter_menuSearchTextPDF), object: nil)
+                    }
                 )
-            }
+            )
         }
         
         // IMAGE - VIDEO - AUDIO

+ 1 - 5
iOSClient/Main/Menu/NCMainMenuTableViewController.swift

@@ -81,11 +81,7 @@ class NCMainMenuTableViewController: UITableViewController {
 extension NCMainMenuTableViewController: FloatingPanelControllerDelegate {
 
     func floatingPanel(_ vc: FloatingPanelController, layoutFor newCollection: UITraitCollection) -> FloatingPanelLayout? {
-        if #available(iOS 11.0, *) {
-            return NCMainMenuFloatingPanelLayout(height: self.actions.count * 60 + Int((UIApplication.shared.keyWindow?.rootViewController!.view.safeAreaInsets.bottom)!))
-        } else {
-            return NCMainMenuFloatingPanelLayout(height: self.actions.count * 60)
-        }
+        return NCMainMenuFloatingPanelLayout(height: self.actions.count * 60 + Int((UIApplication.shared.keyWindow?.rootViewController!.view.safeAreaInsets.bottom)!))
     }
 
     func floatingPanel(_ vc: FloatingPanelController, behaviorFor newCollection: UITraitCollection) -> FloatingPanelBehavior? {

+ 1 - 6
iOSClient/Main/Menu/NCMenuPanelController.swift

@@ -36,11 +36,6 @@ class NCMenuPanelController: FloatingPanelController {
             self.surfaceView.backgroundColor = .systemBackground
         }
         self.isRemovalInteractionEnabled = true
-        if #available(iOS 11, *) {
-            self.surfaceView.cornerRadius = 16
-        } else {
-            self.surfaceView.cornerRadius = 0
-        }
+        self.surfaceView.cornerRadius = 16
     }
-
 }

+ 8 - 21
iOSClient/Main/NCDetailViewController.swift

@@ -461,6 +461,7 @@ class NCDetailViewController: UIViewController {
         if metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_audio || metadata.typeFile == k_metadataTypeFile_video {
             
             viewImage()
+            
             return
         }
     
@@ -469,32 +470,18 @@ class NCDetailViewController: UIViewController {
             
             // PDF
             if metadata.contentType == "application/pdf" {
-                if #available(iOS 11.0, *) {
-                    
-                    let frame = CGRect(x: 0, y: 0, width: self.backgroundView.frame.width, height: self.backgroundView.frame.height)
-                    let viewerPDF = NCViewerPDF.init(frame: frame)
                     
-                    let filePath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
-                    if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) == false {
-                        return
-                    }
+                let frame = CGRect(x: 0, y: 0, width: self.backgroundView.frame.width, height: self.backgroundView.frame.height)
+                let viewerPDF = NCViewerPDF.init(frame: frame)
                     
-                    viewerPDF.setupPdfView(filePath: URL(fileURLWithPath: filePath), view: backgroundView)
+                let filePath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
+                if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) == false {
                     
-                } else {
+                    return
+                }
                     
-                    let fileNamePath = NSTemporaryDirectory() + metadata.fileNameView
+                viewerPDF.setupPdfView(filePath: URL(fileURLWithPath: filePath), view: backgroundView)
 
-                    CCUtility.copyFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView), toPath: fileNamePath)
-
-                    viewerQuickLook = NCViewerQuickLook.init()
-                    viewerQuickLook?.quickLook(url: URL(fileURLWithPath: fileNamePath), viewController: self)
-                    
-                    DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
-                        self.unload(checkWindow: false)
-                    }
-                }
-                
                 return
             }
             

+ 2 - 6
iOSClient/Offline/NCOffline.swift

@@ -85,12 +85,8 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
         listLayout = NCListLayout()
         gridLayout = NCGridLayout()
         
-        // Add Refresh Control
-        if #available(iOS 10.0, *) {
-            collectionView.refreshControl = refreshControl
-        } else {
-            collectionView.addSubview(refreshControl)
-        }
+        // Refresh Control
+        collectionView.addSubview(refreshControl)
         
         // Configure Refresh Control
         refreshControl.tintColor = NCBrandColor.sharedInstance.brandText

+ 1 - 4
iOSClient/RichWorkspace/NCViewerRichWorkspaceWebView.swift

@@ -53,10 +53,7 @@ class NCViewerRichWorkspaceWebView: UIViewController, WKNavigationDelegate, WKSc
     }
     
     @objc func keyboardDidShow(notification: Notification) {
-        var safeAreaInsetsBottom: CGFloat = 0
-        if #available(iOS 11.0, *) {
-            safeAreaInsetsBottom = UIApplication.shared.keyWindow!.safeAreaInsets.bottom
-        }
+        let safeAreaInsetsBottom = UIApplication.shared.keyWindow!.safeAreaInsets.bottom
         guard let info = notification.userInfo else { return }
         guard let frameInfo = info[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue else { return }
         let keyboardFrame = frameInfo.cgRectValue

+ 0 - 8
iOSClient/ScanDocument/ScanCollectionView.swift

@@ -23,8 +23,6 @@
 
 import UIKit
 
-@available(iOS 11, *)
-
 class DragDropViewController: UIViewController {
     
     //Data Source for collectionViewSource
@@ -369,8 +367,6 @@ class DragDropViewController: UIViewController {
 
 // MARK: - UICollectionViewDataSource Methods
 
-@available(iOS 11, *)
-
 extension DragDropViewController : UICollectionViewDataSource {
     
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
@@ -498,8 +494,6 @@ extension UIImage {
 
 // MARK: - UICollectionViewDragDelegate Methods
 
-@available(iOS 11, *)
-
 extension DragDropViewController : UICollectionViewDragDelegate
 {
     func collectionView(_ collectionView: UICollectionView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) -> [UIDragItem] {
@@ -561,8 +555,6 @@ extension DragDropViewController : UICollectionViewDragDelegate
 
 // MARK: - UICollectionViewDropDelegate Methods
 
-@available(iOS 11, *)
-
 extension DragDropViewController : UICollectionViewDropDelegate {
     
     func collectionView(_ collectionView: UICollectionView, canHandle session: UIDropSession) -> Bool {

+ 1 - 5
iOSClient/Select/NCSelect.swift

@@ -117,11 +117,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, NCListCellDelegat
         gridLayout = NCGridLayout()
         
         // Add Refresh Control
-        if #available(iOS 10.0, *) {
-            collectionView.refreshControl = refreshControl
-        } else {
-            collectionView.addSubview(refreshControl)
-        }
+        collectionView.addSubview(refreshControl)
         
         // Configure Refresh Control
         refreshControl.tintColor = NCBrandColor.sharedInstance.brandText

+ 1 - 4
iOSClient/Share/NCShare.swift

@@ -257,10 +257,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
         appearance.shadowRadius = 25
         appearance.animationduration = 0.25
         appearance.textColor = .darkGray
-        
-        if #available(iOS 11.0, *) {
-            appearance.setupMaskedCorners([.layerMaxXMaxYCorner, .layerMinXMaxYCorner])
-        }
+        appearance.setupMaskedCorners([.layerMaxXMaxYCorner, .layerMinXMaxYCorner])
         
         for item in items {
             if item.displayName != nil && item.displayName != "" {

+ 2 - 6
iOSClient/Share/NCShareCommon.swift

@@ -53,9 +53,7 @@ class NCShareCommon: NSObject {
 //        let globalPoint = shareViewController.view.superview?.convert(shareViewController.view.frame.origin, to: nil)
 //        let constantTrailingAnchor = window.bounds.width - shareViewController.view.bounds.width - globalPoint!.x + 40
 //        var constantBottomAnchor: CGFloat = 10
-//        if #available(iOS 11.0, *) {
-//            constantBottomAnchor = constantBottomAnchor + UIApplication.shared.keyWindow!.safeAreaInsets.bottom
-//        }
+//        constantBottomAnchor = constantBottomAnchor + UIApplication.shared.keyWindow!.safeAreaInsets.bottom
         
         window.addSubview(viewWindow)
         viewWindow.autoresizingMask = [.flexibleWidth, .flexibleHeight]
@@ -99,9 +97,7 @@ class NCShareCommon: NSObject {
 //        let globalPoint = shareViewController.view.superview?.convert(shareViewController.view.frame.origin, to: nil)
 //        let constantTrailingAnchor = window.bounds.width - shareViewController.view.bounds.width - globalPoint!.x + 40
 //        var constantBottomAnchor: CGFloat = 10
-//        if #available(iOS 11.0, *) {
-//            constantBottomAnchor = constantBottomAnchor + UIApplication.shared.keyWindow!.safeAreaInsets.bottom
-//        }
+//        constantBottomAnchor = constantBottomAnchor + UIApplication.shared.keyWindow!.safeAreaInsets.bottom
         
         window.addSubview(viewWindow)
         viewWindow.autoresizingMask = [.flexibleWidth, .flexibleHeight]

+ 1 - 3
iOSClient/Utility/NCStoreReview.swift

@@ -56,9 +56,7 @@ class NCStoreReview: NSObject {
         let runs = getRunCounts()
         
         if (runs > minimumRunCount) {
-            if #available(iOS 10.3, *) {
-                SKStoreReviewController.requestReview()
-            }
+            SKStoreReviewController.requestReview()
         }
     }
 }

+ 10 - 13
iOSClient/Utility/NCUtility.swift

@@ -485,22 +485,19 @@ class NCUtility: NSObject {
     }
     
     @objc func pdfThumbnail(url: URL, width: CGFloat = 240) -> UIImage? {
-        if #available(iOS 11.0, *) {
-            guard let data = try? Data(contentsOf: url), let page = PDFDocument(data: data)?.page(at: 0) else {
-                return nil
-            }
+       
+        guard let data = try? Data(contentsOf: url), let page = PDFDocument(data: data)?.page(at: 0) else {
+            return nil
+        }
 
-            let pageSize = page.bounds(for: .mediaBox)
-            let pdfScale = width / pageSize.width
+        let pageSize = page.bounds(for: .mediaBox)
+        let pdfScale = width / pageSize.width
 
-            // Apply if you're displaying the thumbnail on screen
-            let scale = UIScreen.main.scale * pdfScale
-            let screenSize = CGSize(width: pageSize.width * scale, height: pageSize.height * scale)
+        // Apply if you're displaying the thumbnail on screen
+        let scale = UIScreen.main.scale * pdfScale
+        let screenSize = CGSize(width: pageSize.width * scale, height: pageSize.height * scale)
 
-            return page.thumbnail(of: screenSize, for: .mediaBox)
-        } else {
-            return nil
-        }
+        return page.thumbnail(of: screenSize, for: .mediaBox)
     }
     
     @objc func getMetadataConflict(account: String, serverUrl: String, fileName: String) -> tableMetadata? {

+ 7 - 16
iOSClient/Viewer/NCViewerImage/NCViewerImageViewController.swift

@@ -326,22 +326,13 @@ extension NCViewerImageViewController {
         view.addSubview(statusView)
         statusView.translatesAutoresizingMaskIntoConstraints = false
         
-        if #available(iOS 11, *) {
-            NSLayoutConstraint.activate([
-                statusView.widthAnchor.constraint(equalToConstant: 30),
-                statusView.heightAnchor.constraint(equalToConstant: 30),
-                statusView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 2),
-                statusView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 2)
-            ])
-        } else {
-            NSLayoutConstraint.activate([
-                statusView.widthAnchor.constraint(equalToConstant: 30),
-                statusView.heightAnchor.constraint(equalToConstant: 30),
-                statusView.topAnchor.constraint(equalTo: view.topAnchor, constant: 2),
-                statusView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 2)
-            ])
-        }
-        
+        NSLayoutConstraint.activate([
+            statusView.widthAnchor.constraint(equalToConstant: 30),
+            statusView.heightAnchor.constraint(equalToConstant: 30),
+            statusView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 2),
+            statusView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 2)
+        ])
+       
         statusView.setNeedsLayout()
         statusView.layoutIfNeeded()
 

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

@@ -24,8 +24,6 @@
 import Foundation
 import PDFKit
 
-@available(iOS 11, *)
-
 @objc class NCViewerPDF: PDFView, NCViewerPDFSearchDelegate {
     
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate

+ 0 - 4
iOSClient/Viewer/NCViewerPDF/NCViewerPDFSearch.swift

@@ -24,14 +24,10 @@
 import Foundation
 import PDFKit
 
-@available(iOS 11, *)
-
 @objc protocol NCViewerPDFSearchDelegate : class {
     func searchPdfSelection(_ pdfSelection: PDFSelection)
 }
 
-@available(iOS 11, *)
-
 class NCViewerPDFSearch: UITableViewController, UISearchBarDelegate, PDFDocumentDelegate {
     
     var searchBar = UISearchBar()

+ 1 - 10
iOSClient/Viewer/NCViewerVideo.swift

@@ -29,7 +29,6 @@ class NCViewerVideo: NSObject {
     var metadata: tableMetadata!
     var videoURL: URL?
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
-    var safeAreaBottom: Int = 0
 
     @objc static let sharedInstance: NCViewerVideo = {
         let viewVideo = NCViewerVideo()
@@ -43,14 +42,6 @@ class NCViewerVideo: NSObject {
 
         self.metadata = metadata
         
-        guard let rootView = UIApplication.shared.keyWindow else {
-            return
-        }
-        
-        if #available(iOS 11.0, *) {
-            safeAreaBottom = Int(rootView.safeAreaInsets.bottom)
-        }
-        
         if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
         
             self.videoURL = URL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView))
@@ -84,7 +75,7 @@ class NCViewerVideo: NSObject {
         
         NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: nil, queue: nil) { (notification) in
             let player = notification.object as! AVPlayerItem
-            player.seek(to: CMTime.zero)
+            player.seek(to: CMTime.zero, completionHandler: nil)
         }
         
         DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {