Getsy
Getsy

Reputation: 4905

iOS: Zoom in/out animation for showing an UIView

I have one view controller, where i have two buttons. Clicking on one button, i'll show an UIView (size: 900 * 600) programmatically. Right now, this view comes just like that clicking on that button action. But, i want to have this view coming as if kind of "zoom in" animation and show to the user, and when user closes this view, it will go like "zoom out" and removed from parent view.

Could you please suggest me, how i can achieve this animation?

Thanks.

Upvotes: 0

Views: 2365

Answers (1)

AlexWien
AlexWien

Reputation: 28727

The property transform is animatable. So create CGAffineTransformMakeScale with destination scale factor, and set the

view.transform = scaleTransform;

inside the animation block.

Upvotes: 1

Related Questions