marinofaggiana hace 4 años
padre
commit
63c58a6ea7

+ 8 - 11
iOSClient/AppDelegate.swift

@@ -4,6 +4,7 @@
 
 import UIKit
 import NCCommunication
+import TOPasscodeViewController
 
 @UIApplicationMain
 class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -16,8 +17,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     var userID: String = ""
     var password: String = ""
     
-    var activeServerUrl: String = ""
-    
     var activeFavorite: NCFavorite?
     var activeFiles: NCFiles?
     var activeFileViewInFolder: NCFileViewInFolder?
@@ -27,26 +26,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     var activeMore: NCMore?
     var activeOffline: NCOffline?
     var activeRecent: NCRecent?
+    var activeServerUrl: String = ""
     var activeShares: NCShares?
     var activeTransfers: NCTransfers?
     var activeTrash: NCTrash?
     var activeViewController: UIViewController?
     var activeViewerVideo: NCViewerVideo?
     
-    var timerErrorNetworking: Timer?
+    var disableSharesView: Bool = false
     var documentPickerViewController: NCDocumentPickerViewController?
+    var networkingAutoUpload: NCNetworkingAutoUpload?
+    var passcodeViewController: TOPasscodeViewController?
+    var pasteboardOcIds: [String] = []
     var shares: [tableShare] = []
+    var timerErrorNetworking: Timer?
 
-    
     /*
-    //@property (nonatomic) UIUserInterfaceStyle preferredUserInterfaceStyle API_AVAILABLE(ios(12.0));
-    @property (nonatomic, strong) NSArray *shares;
-    @property BOOL disableSharesView;
+    @property (nonatomic) UIUserInterfaceStyle preferredUserInterfaceStyle API_AVAILABLE(ios(12.0));
     @property (nonatomic, strong) NSUserDefaults *ncUserDefaults;
-    @property (nonatomic, strong) NCNetworkingAutoUpload *networkingAutoUpload;
-    @property (nonatomic, retain) TOPasscodeViewController *passcodeViewController;
-
-    @property (nonatomic, strong) NSMutableArray *pasteboardOcIds;
 */
     
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

+ 1 - 1
iOSClient/Login/NCLoginWeb.swift

@@ -87,7 +87,7 @@ class NCLoginWeb: UIViewController {
         super.viewDidAppear(animated)
         
         // Stop timer error network
-        appDelegate.timerErrorNetworking.invalidate()
+        appDelegate.timerErrorNetworking?.invalidate()
     }
     
     override func viewDidDisappear(_ animated: Bool) {

+ 1 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadScanDocument.swift

@@ -578,7 +578,7 @@ class NCCreateFormUploadScanDocument: XLFormViewController, NCSelectDelegate, NC
 
         NCManageDatabase.shared.addMetadata(metadata)
         
-        appDelegate.networkingAutoUpload.startProcess()
+        appDelegate.networkingAutoUpload?.startProcess()
                         
         // Request delete all image scanned
         let alertController = UIAlertController(title: "", message: NSLocalizedString("_delete_all_scanned_images_", comment: ""), preferredStyle: .alert)

+ 2 - 2
iOSClient/Main/NCPickerViewController.swift

@@ -145,7 +145,7 @@ class NCDocumentPickerViewController: NSObject, UIDocumentPickerDelegate {
             coordinator.coordinate(readingItemAt: url, options: NSFileCoordinator.ReadingOptions.forUploading, error: nil) { (url) in
                 
                 let fileName = url.lastPathComponent
-                let serverUrl = appDelegate.activeServerUrl!
+                let serverUrl = appDelegate.activeServerUrl
                 let ocId = NSUUID().uuidString
                 let data = try? Data.init(contentsOf: url)
                 let path = URL(fileURLWithPath: CCUtility.getDirectoryProviderStorageOcId(ocId, fileNameView: fileName)!)
@@ -174,7 +174,7 @@ class NCDocumentPickerViewController: NSObject, UIDocumentPickerDelegate {
                         } else {
                             
                             NCManageDatabase.shared.addMetadata(metadataForUpload)
-                            appDelegate.networkingAutoUpload.startProcess()
+                            appDelegate.networkingAutoUpload?.startProcess()
                         }
                         
                     } catch {

+ 2 - 2
iOSClient/Networking/NCAutoUpload.swift

@@ -70,7 +70,7 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
                     if hasPermission {
                         self.uploadAssetsNewAndFull(viewController: nil, selector: NCBrandGlobal.shared.selectorUploadAutoUpload, log: "Change location") { (items) in
                             if items > 0 {
-                                self.appDelegate.networkingAutoUpload.startProcess()
+                                self.appDelegate.networkingAutoUpload?.startProcess()
                             }
                         }
                     }
@@ -104,7 +104,7 @@ class NCAutoUpload: NSObject, CLLocationManagerDelegate {
                     if hasPermission {
                         self.uploadAssetsNewAndFull(viewController:viewController, selector: NCBrandGlobal.shared.selectorUploadAutoUpload, log: "Init Auto Upload") { (items) in
                             if items > 0 {
-                                self.appDelegate.networkingAutoUpload.startProcess()
+                                self.appDelegate.networkingAutoUpload?.startProcess()
                             }
                             completion(items)
                         }