Marino Faggiana 8 lat temu
rodzic
commit
bffc2349e4

+ 20 - 4
Picker/Base.lproj/MainInterface.storyboard

@@ -6,6 +6,7 @@
     <dependencies>
         <deployment identifier="iOS"/>
         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
@@ -32,13 +33,28 @@
                                             <rect key="frame" x="0.0" y="0.0" width="375" height="59"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
-                                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Wk9-rb-4yv">
-                                                    <rect key="frame" x="10" y="10" width="40" height="40"/>
-                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Wk9-rb-4yv">
+                                                    <rect key="frame" x="10" y="9" width="40" height="40"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="40" id="OjC-WK-8oe"/>
+                                                        <constraint firstAttribute="height" constant="40" id="mef-gN-2ly"/>
+                                                    </constraints>
                                                 </imageView>
+                                                <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="FileName" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xDF-xa-qvc">
+                                                    <rect key="frame" x="66" y="21" width="301" height="16"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
+                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
                                             </subviews>
+                                            <constraints>
+                                                <constraint firstItem="Wk9-rb-4yv" firstAttribute="leading" secondItem="44X-Sr-gc0" secondAttribute="leadingMargin" constant="2" id="JC3-NE-SK8"/>
+                                                <constraint firstItem="Wk9-rb-4yv" firstAttribute="centerY" secondItem="44X-Sr-gc0" secondAttribute="centerY" id="cFG-TN-r8I"/>
+                                            </constraints>
                                         </tableViewCellContentView>
                                         <connections>
+                                            <outlet property="FileName" destination="xDF-xa-qvc" id="6wi-ij-Q1o"/>
                                             <outlet property="fileImageView" destination="Wk9-rb-4yv" id="K2a-JK-zkR"/>
                                         </connections>
                                     </tableViewCell>
@@ -63,7 +79,7 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="UoZ-ya-W3e" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="121" y="142"/>
+            <point key="canvasLocation" x="120.8" y="141.67916041979012"/>
         </scene>
     </scenes>
 </document>

+ 24 - 5
Picker/DocumentPickerViewController.swift

@@ -95,6 +95,9 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         }
         
         CCNetworking.shared().settingDelegate(self)
+        
+        // COLOR_SEPARATOR_TABLE
+        self.tableView.separatorColor = UIColor(colorLiteralRed: 153.0/255.0, green: 153.0/255.0, blue: 153.0/255.0, alpha: 0.2)
     }
     
     override func viewWillAppear(_ animated: Bool) {
@@ -110,11 +113,14 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
     }
 }
 
-// MARK: - Class UITableViewCell
+// MARK: - UITableViewDelegate
 
-class recordMetadataCell: UITableViewCell {
-    
-    @IBOutlet weak var fileImageView: UIImageView!
+extension DocumentPickerViewController: UITableViewDelegate {
+
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        
+         return 60
+    }
 }
 
 // MARK: - UITableViewDataSource
@@ -125,11 +131,13 @@ extension DocumentPickerViewController: UITableViewDataSource {
         
         return recordsTableMetadata.count
     }
-    
+        
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         
         let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! recordMetadataCell
         
+        cell.separatorInset = UIEdgeInsetsMake(0, 60, 0, 0)
+        
         let recordMetadata = recordsTableMetadata[(indexPath as NSIndexPath).row]
         let metadata = CCCoreData.insertEntity(in: recordMetadata)!
         
@@ -145,7 +153,18 @@ extension DocumentPickerViewController: UITableViewDataSource {
             cell.fileImageView.image = UIImage(named: metadata.iconName!)
         }
         
+        // File Name
+        cell.FileName.text = metadata.fileNamePrint!
+        
         return cell
     }
 }
 
+// MARK: - Class UITableViewCell
+
+class recordMetadataCell: UITableViewCell {
+    
+    @IBOutlet weak var fileImageView: UIImageView!
+    @IBOutlet weak var FileName : UILabel!
+}
+

+ 2 - 1
Picker/Picker-Bridging-Header.h

@@ -7,8 +7,9 @@
 
 #import "TableAccount.h"
 #import "CCCoreData.h"
+#import "CCGlobal.h"
+
 
 #import "CCHud.h"
 #import "CCMove.h"
 #import "CCSection.h"
-#import "CCGlobal.h"