Parvesh Singh Parvesh Singh - 2 days ago 4
Objective-C Question

How to zoom in the content of cell in uicollectionview

enter image description here

In the above image,A,B,C,D,E are each custom cell,of collection view and i want to zoom in the cell one by one like c cell.

Any suggestion?

Answer

Just call this method when your collectionviewcell click

[self animateZoomforCell:cell]; // pass cell as collectionviewcell

-(void)animateZoomforCell:(UICollectionViewCell*)zoomCell
{
    [UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{

        zoomCell.transform = CGAffineTransformMakeScale(1.6,1.6);
    } completion:^(BOOL finished){
    }];
}
-(void)animateZoomforCellremove:(UICollectionViewCell*)zoomCell
{
    [UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{

        zoomCell.transform = CGAffineTransformMakeScale(1.0,1.0);
    } completion:^(BOOL finished){
    }];
}
Comments