title: Switch/Change the Cells in UICollectionView on click of a UIButton
body: <p>The problem is i have a <code>UICollectionView</code> and i have a custom cell inherited from <code>UICollectionViewCell</code>.Now what i have on <code>UICollectionView</code> is two buttons left and right when i click the right button the cell should change and the next one should come in picture.The Cell has a TextView.And on click of right button the next cell(with textview) should be in picture.similarly on click of left it should display previous one.</p>
  
  <p>Thanks and best regards. </p>
  
  <p>CellforRow:</p>
  
  <pre><code>-(UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {
      if (collectionView == self.myCV) {
          myCollectionView *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MY_CELL" forIndexPath:indexPath];
  
          if (cell == nil)
          {
              NSArray *xibPath = [[NSBundle mainBundle] loadNibNamed:@"myCollectionView" owner:self options:nil];
              cell = [xibPath objectAtIndex:0];
          }
          return cell;
      }
      else if (collectionView == self.myCV2)
      {
          myCC2 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MY_CELL2" forIndexPath:indexPath];
  
          if (cell == nil)
          {
              NSArray *xibPath = [[NSBundle mainBundle] loadNibNamed:@"myCC2" owner:self options:nil];
              cell = [xibPath objectAtIndex:0];
          }
          return cell;
      }
      return 0;
  }
  </code></pre>