marinofaggiana 5 жил өмнө
parent
commit
0bc86f8ec1

+ 8 - 4
iOSClient/Main/CCMain.m

@@ -1119,11 +1119,15 @@
     }
     
     // Verify if file(s) exists
+    if (metadatas.count > 0) {
+        NCCreateFormUploadConflict *conflict = [[UIStoryboard storyboardWithName:@"NCCreateFormUploadConflict" bundle:nil] instantiateInitialViewController];
+        conflict.metadatas = metadatas;
+        
+        [self presentViewController:conflict animated:YES completion:nil];
+    }
     
-    
-    [appDelegate startLoadAutoDownloadUpload];
-    
-    [[NCMainCommon sharedInstance] reloadDatasourceWithServerUrl:self.serverUrl ocId:nil action:k_action_NULL];
+    //[appDelegate startLoadAutoDownloadUpload];
+    //[[NCMainCommon sharedInstance] reloadDatasourceWithServerUrl:self.serverUrl ocId:nil action:k_action_NULL];
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 5 - 1
iOSClient/Main/Create cloud/NCCreateFormUploadConflict.storyboard

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="30l-Wp-khL">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
@@ -70,6 +70,10 @@
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="wkN-gS-XKZ">
                                 <rect key="frame" x="10" y="247.5" width="394" height="544.5"/>
                                 <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                                <connections>
+                                    <outlet property="dataSource" destination="30l-Wp-khL" id="TVO-SU-fFp"/>
+                                    <outlet property="delegate" destination="30l-Wp-khL" id="Qzt-sk-KEh"/>
+                                </connections>
                             </tableView>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Fow-JU-J8L">
                                 <rect key="frame" x="10" y="802" width="394" height="50"/>

+ 9 - 15
iOSClient/Main/Create cloud/NCCreateFormUploadConflict.swift

@@ -23,7 +23,7 @@
 
 import Foundation
 
-class NCCreateFormUploadConflict: UIViewController {
+@objc class NCCreateFormUploadConflict: UIViewController {
 
     @IBOutlet weak var labelTitle: UILabel!
     @IBOutlet weak var labelSubTitle: UILabel!
@@ -40,21 +40,11 @@ class NCCreateFormUploadConflict: UIViewController {
     @IBOutlet weak var buttonContinue: UIButton!
     
     private let appDelegate = UIApplication.shared.delegate as! AppDelegate
-    private var metadatas: [tableMetadata]
+    @objc var metadatas: [tableMetadata]
     
-    // This is also necessary when extending the superclass.
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented") // or see Roman Sausarnes's answer
-    }
-    
-    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
+    @objc required init?(coder aDecoder: NSCoder) {
         self.metadatas = [tableMetadata]()
-        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
-    }
-    
-    convenience init(metadatas: [tableMetadata]) {
-        self.init(nibName:nil, bundle:nil)
-        self.metadatas = metadatas
+        super.init(coder: aDecoder)
     }
     
     override func viewDidLoad() {
@@ -73,7 +63,7 @@ class NCCreateFormUploadConflict: UIViewController {
 extension NCCreateFormUploadConflict: UITableViewDelegate {
     
     func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return 60
+        return 100
     }
 }
 
@@ -93,6 +83,10 @@ extension NCCreateFormUploadConflict: UITableViewDataSource {
         
         if let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as? NCCreateFormUploadConflictCell {
             
+            let metadata = metadatas[indexPath.row]
+            
+            cell.labelFileName.text = metadata.fileNameView
+            
             return cell
         }