Browse Source

clear code

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana 2 years ago
parent
commit
5a5db058a4

+ 0 - 1
iOSClient/AppDelegate.swift

@@ -42,7 +42,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
     var deletePasswordSession: Bool = false
     var activeAppConfigView: NCAppConfigView?
-    var activeFiles: NCFiles?
     var activeLogin: NCLogin?
     var activeLoginWeb: NCLoginWeb?
     @objc var activeMedia: NCMedia?

+ 0 - 1
iOSClient/Files/NCFiles.swift

@@ -34,7 +34,6 @@ class NCFiles: NCCollectionViewCommon {
     required init?(coder aDecoder: NSCoder) {
         super.init(coder: aDecoder)
 
-        appDelegate.activeFiles = self
         titleCurrentFolder = NCBrandOptions.shared.brand
         layoutKey = NCGlobal.shared.layoutViewFiles
         enableSearchBar = true

+ 2 - 1
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -883,7 +883,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
             if let viewerRichWorkspace = navigationController.topViewController as? NCViewerRichWorkspace {
                 viewerRichWorkspace.richWorkspaceText = richWorkspaceText ?? ""
                 viewerRichWorkspace.serverUrl = serverUrl
-
+                viewerRichWorkspace.delegate = self
+                
                 navigationController.modalPresentationStyle = .fullScreen
                 self.present(navigationController, animated: true, completion: nil)
             }

+ 4 - 3
iOSClient/RichWorkspace/NCViewerRichWorkspace.swift

@@ -34,8 +34,9 @@ import MarkdownKit
     private var markdownParser = MarkdownParser()
     private var textViewColor: UIColor?
 
-    @objc public var richWorkspaceText: String = ""
-    @objc public var serverUrl: String = ""
+    var richWorkspaceText: String = ""
+    var serverUrl: String = ""
+    var delegate: NCCollectionViewCommon?
 
     // MARK: - View Life Cycle
 
@@ -66,7 +67,7 @@ import MarkdownKit
                 guard let metadata = metadata else { return }
                 NCManageDatabase.shared.setDirectory(serverUrl: self.serverUrl, richWorkspace: metadata.richWorkspace, account: account)
                 if self.richWorkspaceText != metadata.richWorkspace && metadata.richWorkspace != nil {
-                    self.appDelegate.activeFiles?.richWorkspaceText = self.richWorkspaceText
+                    self.delegate?.richWorkspaceText = self.richWorkspaceText
                     self.richWorkspaceText = metadata.richWorkspace!
                     DispatchQueue.main.async {
                         self.textView.attributedText = self.markdownParser.parse(metadata.richWorkspace!)