如何取消选择所有其他选定的细胞UICollectionView在第0,如果从第1节
选择以下任一单元格是我试过到目前为止:取消选择所有其他选择,如果从其他部分选择一个单元格中UICollectionView
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath){
let cell = collectionView.cellForItemAtIndexPath(indexPath) as! SignupStep3CollectionViewCell
cell.layer.borderWidth = 4
cell.layer.masksToBounds = false
cell.layer.borderColor = UIColor.init(red: 46.0/255.0, green: 234.0/255.0, blue: 219.0/255.0, alpha: 1.0).CGColor
cell.layer.cornerRadius = cell.frame.height/2
cell.clipsToBounds = true
if indexPath.section == 1
{
collectionView.selectItemAtIndexPath(nil, animated: true, scrollPosition: .None)
}
}
这不工作请引导。
“NSIndexpath不confrm以协议序列类型”的错误来 –
更新了答案。你现在可以检查吗? –
仍然错误,使用swift 2 –