Répondre

1

Il suffit d'appeler cette méthode lorsque votre collectionviewcell cliquez sur

[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){ 
    }]; 
} 
+0

merci beaucoup frère! tu as résolu mon problème! –

+0

@ParveshSingh est là votre problème résoudre puis approuver ma réponse et donner le vote afin que l'autre utilisateur peut également trouver une solution. Je vous remercie. codage heureux –

+0

sûr himanshu .... Codage heureux. –

1

En rapide 3 basé sur la solution Himanshu Moradiya:

func animateZoomforCell(zoomCell : UICollectionViewCell) 
{ 
    UIView.animate(
     withDuration: 0.2, 
     delay: 0, 
     options: UIViewAnimationOptions.curveEaseOut, 
     animations: { 
         zoomCell.transform = CGAffineTransform.init(scaleX: 1.2, y: 1.2) 
      }, 
    completion: nil) 
} 
func animateZoomforCellremove(zoomCell : UICollectionViewCell) 
{ 
    UIView.animate(
     withDuration: 0.2, 
     delay: 0, 
     options: UIViewAnimationOptions.curveEaseOut, 
     animations: { 
      zoomCell.transform = CGAffineTransform.init(scaleX: 1.0, y: 1.0) 
    }, 
     completion: nil) 

}