Zoom in Zoom out animation IOS

 
zoom in zoom out animation ios
 
 

Zoom in and Zoom out animation using  CGAffineTransformation

In this post, I am going to share a simple animation for ZOOM IN and ZOOM OUT of a UIView in IOS.

Code for zoom in:

 [UIView animateWithDuration:1.0 animations:^{
        imgv.transform = CGAffineTransformMakeScale(1.0,1.0);
 
    }completion:^(BOOL finished){
 
    }];

Code for zoom out: 

[UIView animateWithDuration:1.0 animations:^{
        imgv.transform = CGAffineTransformMakeScale(0.1,0.1);
        
    }completion:^(BOOL finished){
        imgv.transform = CGAffineTransformMakeScale(.0,.0);    
    }];
 
Here imgv is my UIImageview object. You can replace it with your view object. In zoom out code we hide the view by scaling it to 0.

Source Code: Download here

Read more articles

Create custom UIPageViewController using UIScrollView and UIPageControl – Tutorial IOS (objective C)

Get thumbnail from video url in swift