Преглед на файлове

remove ios12

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana преди 2 години
родител
ревизия
ded1b4cb32

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -3342,7 +3342,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 12.1;
+				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
@@ -3402,7 +3402,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 12.1;
+				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",

+ 0 - 4
iOSClient/AppDelegate.swift

@@ -353,7 +353,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
     // MARK: - Background Task
 
-    @available(iOS 13.0, *)
     func scheduleAppRefresh() {
 
         let request = BGAppRefreshTaskRequest(identifier: NCGlobal.shared.refreshTask)
@@ -366,7 +365,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         }
     }
 
-    @available(iOS 13.0, *)
     func scheduleBackgroundProcessing() {
 
         let request = BGProcessingTaskRequest(identifier: NCGlobal.shared.processingTask)
@@ -381,7 +379,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         }
     }
 
-    @available(iOS 13.0, *)
     func handleRefreshTask(_ task: BGTask) {
 
         if account == "" {
@@ -399,7 +396,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         }
     }
 
-    @available(iOS 13.0, *)
     func handleProcessingTask(_ task: BGTask) {
 
         if account == "" {

+ 8 - 3
iOSClient/Extensions/UIImage+Extensions.swift

@@ -139,9 +139,14 @@ extension UIImage {
     }
 
     func imageColor(_ color: UIColor) -> UIImage {
-        return UIGraphicsImageRenderer(size: size, format: imageRendererFormat).image { _ in
-            color.set()
-            withRenderingMode(.alwaysTemplate).draw(at: .zero)
+        
+        if #available(iOS 13.0, *) {
+            return self.withTintColor(color, renderingMode: .alwaysOriginal)
+        } else {
+            return UIGraphicsImageRenderer(size: size, format: imageRendererFormat).image { _ in
+                color.set()
+                withRenderingMode(.alwaysTemplate).draw(at: .zero)
+            }
         }
     }
 

+ 0 - 3
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -921,7 +921,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         openMenuItems(with: nil, gestureRecognizer: gestureRecognizer)
     }
 
-    @available(iOS 13.0, *)
     func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
 
         return UIContextMenuConfiguration(identifier: nil, previewProvider: {
@@ -1316,7 +1315,6 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
         navigationController?.pushViewController(viewController, animated: true)
     }
 
-    @available(iOS 13.0, *)
     func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
 
         guard let metadata = dataSource.cellForItemAt(indexPath: indexPath) else { return nil }
@@ -1341,7 +1339,6 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
         })
     }
 
-    @available(iOS 13.0, *)
     func collectionView(_ collectionView: UICollectionView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
 
         animator.addCompletion {

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

@@ -28,7 +28,6 @@ import VisionKit
 import Photos
 import XLForm
 
-@available(iOS 13.0, *)
 class NCCreateFormUploadScanDocument: XLFormViewController, NCSelectDelegate, NCCreateFormUploadConflictDelegate {
 
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
@@ -721,7 +720,6 @@ class NCCreateFormUploadScanDocument: XLFormViewController, NCSelectDelegate, NC
 
 }
 
-@available(iOS 13.0, *)
 class NCCreateScanDocument: NSObject, VNDocumentCameraViewControllerDelegate {
     @objc static let shared: NCCreateScanDocument = {
         let instance = NCCreateScanDocument()

+ 0 - 1
iOSClient/Main/NCFunctionCenter.swift

@@ -587,7 +587,6 @@ import Photos
 
     // MARK: - Context Menu Configuration
 
-    @available(iOS 13.0, *)
     func contextMenuConfiguration(ocId: String, viewController: UIViewController, enableDeleteLocal: Bool, enableViewInFolder: Bool, image: UIImage?) -> UIMenu {
 
         guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) else {

+ 0 - 2
iOSClient/Media/NCMedia.swift

@@ -324,7 +324,6 @@ extension NCMedia: UICollectionViewDelegate {
         }
     }
 
-    @available(iOS 13.0, *)
     func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
 
         guard let cell = collectionView.cellForItem(at: indexPath) as? NCGridMediaCell else { return nil }
@@ -339,7 +338,6 @@ extension NCMedia: UICollectionViewDelegate {
         })
     }
 
-    @available(iOS 13.0, *)
     func collectionView(_ collectionView: UICollectionView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
         animator.addCompletion {
             if let indexPath = configuration.identifier as? IndexPath {

+ 0 - 1
iOSClient/Networking/NCNetworking.swift

@@ -1407,7 +1407,6 @@ import Photos
 
     // MARK: - TEST API
 
-    @available(iOS 13.0, *)
     func getPreview(url: URL, options: NKRequestOptions = NKRequestOptions()) async throws -> Data? {
 
         try await withUnsafeThrowingContinuation { continuation in

+ 0 - 3
iOSClient/ScanDocument/NCScan+CollectionView.swift

@@ -23,7 +23,6 @@
 
 import Foundation
 
-@available(iOS 13.0, *)
 extension NCScan: UICollectionViewDataSource {
 
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
@@ -89,7 +88,6 @@ extension NCScan: UICollectionViewDataSource {
     }
 }
 
-@available(iOS 13.0, *)
 extension NCScan: UICollectionViewDragDelegate {
     func collectionView(_ collectionView: UICollectionView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) -> [UIDragItem] {
 
@@ -148,7 +146,6 @@ extension NCScan: UICollectionViewDragDelegate {
     }
 }
 
-@available(iOS 13.0, *)
 extension NCScan: UICollectionViewDropDelegate {
 
     func collectionView(_ collectionView: UICollectionView, canHandle session: UIDropSession) -> Bool {

+ 0 - 2
iOSClient/ScanDocument/NCScan.swift

@@ -25,7 +25,6 @@ import UIKit
 import Photos
 import EasyTipView
 
-@available(iOS 13.0, *)
 class NCScan: UIViewController, NCScanCellCellDelegate {
 
     @IBOutlet weak var collectionViewSource: UICollectionView!
@@ -406,7 +405,6 @@ class NCScan: UIViewController, NCScanCellCellDelegate {
     }
 }
 
-@available(iOS 13.0, *)
 extension NCScan: EasyTipViewDelegate {
 
     // TIP

+ 14 - 19
iOSClient/Settings/CCManageAccount.m

@@ -102,19 +102,18 @@
         }
         
         // Set user status
-        if (@available(iOS 13.0, *)) {
-            BOOL userStatus = [[NCManageDatabase shared] getCapabilitiesServerBoolWithAccount:activeAccount.account elements:NCElementsJSON.shared.capabilitiesUserStatusEnabled exists:false];
-            if (userStatus) {
-                row = [XLFormRowDescriptor formRowDescriptorWithTag:@"setUserStatus" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_set_user_status_", nil)];
-                row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.secondarySystemGroupedBackground;
-                [row.cellConfig setObject:NCBrandColor.shared.label forKey:@"textLabel.textColor"];
-                [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
-                [row.cellConfig setObject:[[UIImage imageNamed:@"userStatusAway"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
-                [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
-                row.action.formSelector = @selector(setUserStatus:);
-                if (accounts.count == 0) row.disabled = @YES;
-                [section addFormRow:row];
-            }
+        
+        BOOL userStatus = [[NCManageDatabase shared] getCapabilitiesServerBoolWithAccount:activeAccount.account elements:NCElementsJSON.shared.capabilitiesUserStatusEnabled exists:false];
+        if (userStatus) {
+            row = [XLFormRowDescriptor formRowDescriptorWithTag:@"setUserStatus" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_set_user_status_", nil)];
+            row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.secondarySystemGroupedBackground;
+            [row.cellConfig setObject:NCBrandColor.shared.label forKey:@"textLabel.textColor"];
+            [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
+            [row.cellConfig setObject:[[UIImage imageNamed:@"userStatusAway"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
+            [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
+            row.action.formSelector = @selector(setUserStatus:);
+            if (accounts.count == 0) row.disabled = @YES;
+            [section addFormRow:row];
         }
         
         if ([NCBrandOptions shared].disable_multiaccount == NO) {
@@ -488,12 +487,8 @@
 {
     [self deselectFormRow:sender];
     
-    if (@available(iOS 13.0, *)) {
-        
-        UINavigationController *navigationController = [[UIStoryboard storyboardWithName:@"NCUserStatus" bundle:nil] instantiateInitialViewController];
-        
-        [self presentViewController:navigationController animated:YES completion:nil];
-    }
+    UINavigationController *navigationController = [[UIStoryboard storyboardWithName:@"NCUserStatus" bundle:nil] instantiateInitialViewController];
+    [self presentViewController:navigationController animated:YES completion:nil];
 }
 
 #pragma mark -

+ 0 - 1
iOSClient/Transfers/NCTransfers.swift

@@ -153,7 +153,6 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
 
     // MARK: - Collection View
 
-    @available(iOS 13.0, *)
     override func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
         return nil
     }

+ 0 - 5
iOSClient/UserStatus/NCUserStatus.swift

@@ -27,7 +27,6 @@ import Foundation
 import NextcloudKit
 import DropDown
 
-@available(iOS 13.0, *)
 class NCUserStatus: UIViewController {
 
     @IBOutlet weak var buttonCancel: UIBarButtonItem!
@@ -476,7 +475,6 @@ class NCUserStatus: UIViewController {
     }
 }
 
-@available(iOS 13.0, *)
 extension NCUserStatus: UITextFieldDelegate {
 
     func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
@@ -501,7 +499,6 @@ extension NCUserStatus: UITextFieldDelegate {
     }
 }
 
-@available(iOS 13.0, *)
 class emojiTextField: UITextField {
 
     // required for iOS 13
@@ -543,7 +540,6 @@ class emojiTextField: UITextField {
     }
 }
 
-@available(iOS 13.0, *)
 extension NCUserStatus: UITableViewDelegate {
 
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
@@ -577,7 +573,6 @@ extension NCUserStatus: UITableViewDelegate {
     }
 }
 
-@available(iOS 13.0, *)
 extension NCUserStatus: UITableViewDataSource {
 
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

+ 7 - 12
iOSClient/Utility/NCUtility.swift

@@ -668,21 +668,16 @@ class NCUtility: NSObject {
 
         var image: UIImage?
 
-        if #available(iOS 13.0, *) {
-            // see https://stackoverflow.com/questions/71764255
-            let sfSymbolName = imageName.replacingOccurrences(of: "_", with: ".")
-            if let symbolConfiguration = symbolConfiguration {
-                image = UIImage(systemName: sfSymbolName, withConfiguration: symbolConfiguration as? UIImage.Configuration)?.imageColor(color)
-            } else {
-                image = UIImage(systemName: sfSymbolName)?.imageColor(color)
-            }
-            if image == nil {
-                image = UIImage(named: imageName)?.image(color: color, size: size)
-            }
+        // see https://stackoverflow.com/questions/71764255
+        let sfSymbolName = imageName.replacingOccurrences(of: "_", with: ".")
+        if let symbolConfiguration = symbolConfiguration {
+            image = UIImage(systemName: sfSymbolName, withConfiguration: symbolConfiguration as? UIImage.Configuration)?.imageColor(color)
         } else {
+            image = UIImage(systemName: sfSymbolName)?.imageColor(color)
+        }
+        if image == nil {
             image = UIImage(named: imageName)?.image(color: color, size: size)
         }
-
         if let image = image {
             return image
         }

+ 0 - 1
iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLook.swift

@@ -114,7 +114,6 @@ extension NCViewerQuickLook: QLPreviewControllerDataSource, QLPreviewControllerD
         previewItems[index]
     }
 
-    @available(iOS 13.0, *)
     func previewController(_ controller: QLPreviewController, editingModeFor previewItem: QLPreviewItem) -> QLPreviewItemEditingMode {
         return isEditingEnabled ? .createCopy : .disabled
     }