marinofaggiana 5 anos atrás
pai
commit
3330bf7bd4

+ 2 - 2
Cartfile.resolved

@@ -14,10 +14,10 @@ github "huri000/SwiftEntryKit" "1.2.3"
 github "jdg/MBProgressHUD" "1.1.0"
 github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
 github "krzyzanowskim/OpenSSL" "1.0.218"
-github "malcommac/SwiftRichString" "3.5.1"
+github "malcommac/SwiftRichString" "3.6.0"
 github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/FastScroll" "81967c2309d29bc2c330d422da612160a30bade8"
-github "nextcloud/ios-communication-library" "a64291367ceb5bf1b715d0689ca6040cb5c3990e"
+github "nextcloud/ios-communication-library" "6a8244f5e66f2dda4a5e01a89f3fea6f39867500"
 github "realm/realm-cocoa" "v4.1.1"
 github "rechsteiner/Parchment" "v1.7.0"
 github "tilltue/TLPhotoPicker" "2.0.7"

+ 9 - 4
iOSClient/Main/CCMain.m

@@ -1936,10 +1936,15 @@
 
 - (void)viewRichWorkspaceTapAction:(UITapGestureRecognizer *)tapGesture
 {
-    tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND fileNameView LIKE[c] %@", appDelegate.activeAccount, self.serverUrl, k_fileNameRichWorkspace.lowercaseString]];
-    if (metadata) {
-        //[self shouldPerformSegue:metadata selector:selectorViewerRichWorkspace];
-    }
+   tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", appDelegate.activeAccount, self.serverUrl]];
+    
+    UINavigationController *navigationController = [[UIStoryboard storyboardWithName:@"NCViewerRichWorkspace" bundle:nil] instantiateInitialViewController];
+    NCViewerRichWorkspace *ViewerRichWorkspace = (NCViewerRichWorkspace *)[navigationController topViewController];
+    ViewerRichWorkspace.richWorkspace = directory.richWorkspace;
+    
+    navigationController.modalPresentationStyle = UIModalPresentationFullScreen;
+    
+    [self presentViewController:navigationController animated:NO completion:NULL];
 }
 
 - (void)createRichWorkspace

+ 18 - 2
iOSClient/RichWorkspace/NCRichWorkspace.swift

@@ -1,10 +1,26 @@
 //
-//  NCRichWorkspace.swift
+//  NCViewRichWorkspace.swift
 //  Nextcloud
 //
 //  Created by Marino Faggiana on 09/01/2020.
-//  Copyright © 2020 TWS. All rights reserved.
+//  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
 import SwiftRichString

+ 4 - 5
iOSClient/Viewer/NCViewerRichWorkspace.swift

@@ -27,14 +27,13 @@ import Foundation
 
     @IBOutlet weak var viewRichWorkspace: NCViewRichWorkspace!
     
-    let appDelegate = UIApplication.shared.delegate as! AppDelegate
-    
-    public var metadata: tableMetadata?
-    
+    private let appDelegate = UIApplication.shared.delegate as! AppDelegate
+    @objc public var richWorkspace: String = ""
+   
     override func viewDidLoad() {
         super.viewDidLoad()
         
-        
+        viewRichWorkspace.setRichWorkspaceText(richWorkspace)
     }
     
 }