Sunday, 1 March 2015

Zoom in Zoom out animation IOS




zoom in zoom out animation ios

Tags: #Zoom in  #IOS #Zoom out #animation

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 imvv 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

No comments:
Write comments