我添加了两个手势,导致单元格UICollectionView
上下。
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(Storyboard.CellIdentifier, forIndexPath: indexPath) as! CardsCollectionViewCell
cell.card = self.cards[indexPath.item]
let UpSwipe = UISwipeGestureRecognizer(target: self, action: Selector("gestureToUp:"))
UpSwipe.direction = UISwipeGestureRecognizerDirection.Up
cell.addGestureRecognizer(UpSwipe)
let downSwipe = UISwipeGestureRecognizer(target: self, action: Selector("gestureToDown:"))
downSwipe.direction = UISwipeGestureRecognizerDirection.Down
cell.addGestureRecognizer(downSwipe)
return cell
}
func gestureToUp(sender: UISwipeGestureRecognizer){
print("up")
}
func gestureToDown(sender: UISwipeGestureRecognizer){
print("down")
}
我想添加一个等于轻扫的动画来删除电子邮件应用。
我试图做一些等于UITableViewController
的事情,但似乎不允许这样做,而且我读到的关于它的文章没有显示UICollectionView
的单元格。
有些人可以帮助我吗?