The problem is i have a UICollectionView
and i have a custom cell inherited from UICollectionViewCell
.Now what i have on UICollectionView
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.
Thanks and best regards.
CellforRow:
-(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;
}