title: how to single select cell in collection view..?
body: <p><strong>That are code properly working but when i will scroll my collection view then another cell also selected, for example 18 images are available and first show six at run time when i will select any one of the position then next six position image automatic select. why at a time two cell selecting i am  confuse here. please give me solution</strong></p>
  
  <p><img src="https://i.stack.imgur.com/S0iA2.png" alt="enter image description here"></p>
  
  <p><strong>here i have take 6 cell at main show storyboard</strong></p>
  
  <pre><code>UICollectionViewFlowLayout *flowLayout = (UICollectionViewFlowLayout*)self.collectionView.collectionViewLayout;
  
  flowLayout.minimumLineSpacing = 15;
  CGFloat availableWidthForCells = CGRectGetWidth(self.collectionView.frame) - flowLayout.sectionInset.left - flowLayout.sectionInset.right - flowLayout.minimumInteritemSpacing *2;
  
  cellWidth = availableWidthForCells /6;
      NSLog(@"cellWidth:%f",cellWidth);
  flowLayout.itemSize = CGSizeMake(cellWidth, cellWidth);
  </code></pre>
  
  <p><strong>This is my Didselect And didDeselect Method</strong></p>
  
  <pre><code>-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
  
      UICollectionViewCell* cell = [collectionView cellForItemAtIndexPath:indexPath];
  
      cell.layer.cornerRadius = cellWidth / 2.0;
      cell.layer.backgroundColor = [UIColor blackColor].CGColor;
      NSLog(@"INDEXPATH:-%ld",(long)indexPath.row);
  }
  -(void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath{
  
      UICollectionViewCell* cell = [collectionView cellForItemAtIndexPath:indexPath];
      cell.layer.cornerRadius = cellWidth / 2.0;
      cell.layer.backgroundColor = [UIColor whiteColor].CGColor;
  
  }
  </code></pre>