title: How to delete an item from UICollectionView?
body: <p>I am showing images on a <code>collection view</code>.I want to delete each item on a <code>button click</code>.Now I am able to delete the item on <code>didSelect method</code>.</p>
  
  <pre><code>-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
  {
      [array removeObjectAtIndex:indexPath.row];
      [self.colleVIew deleteItemsAtIndexPaths:[NSArray arrayWithObject:indexPath]];
  }
  </code></pre>
  
  <p>I have placed button on <code>CollectionCell</code> and can find out the <code>indexpath.row</code> <code>on click</code>.But how to delete</p>
  
  <pre><code>-(void)chat:(int)i 
  {
      NSLog(@"index path%d",i);
      [array removeObjectAtIndex:i]; // array object is getting removed,how to delete the CollectionviewCell
  }
  </code></pre>