Marino Faggiana 6 年之前
父节点
当前提交
f0cb22a1b1
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 1 1
      iOSClient/Scan/Scan.storyboard
  2. 6 0
      iOSClient/Scan/ScanCollectionView.swift

+ 1 - 1
iOSClient/Scan/Scan.storyboard

@@ -20,7 +20,7 @@
                         <subviews>
                             <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="jwq-kF-6Nq" userLabel="collectionViewSource">
                                 <rect key="frame" x="0.0" y="72" width="375" height="160"/>
-                                <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="160" id="0Wb-eO-Qiu"/>
                                 </constraints>

+ 6 - 0
iOSClient/Scan/ScanCollectionView.swift

@@ -264,6 +264,10 @@ extension DragDropViewController : UICollectionViewDataSource {
         
         let buttonPosition:CGPoint =  sender.convert(.zero, to: self.collectionViewSource)
         let indexPath:IndexPath = self.collectionViewSource.indexPathForItem(at: buttonPosition)!
+        
+        self.itemsSource.remove(at: indexPath.row)
+        
+        self.collectionViewSource.reloadData()
     }
     
     @objc func deleteDestination(_ sender:UIButton) {
@@ -271,7 +275,9 @@ extension DragDropViewController : UICollectionViewDataSource {
         let buttonPosition:CGPoint =  sender.convert(.zero, to: self.collectionViewDestination)
         let indexPath:IndexPath = self.collectionViewDestination.indexPathForItem(at: buttonPosition)!
         
+        self.itemsDestination.remove(at: indexPath.row)
         
+        self.collectionViewDestination.reloadData()
     }
 }