Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Brayden Kness
Brayden Kness
12,492 Points

iOS Photo Browsing App: Custom Transition

I was wondering if there was a way to implement a transition that zooms in on the item selected. This is the same animation that is seen on the springboard of ios 7 that zooms into the app when you click on it

2 Answers

Thomas Nilsen
Thomas Nilsen
14,957 Points

If you just want to zoom in on a photo and not transition to another viewController. Using UIViewAnimation should be enough.

All you need to do is figure out which image was clicked and call this:

- (void)showAnimated:(BOOL)animated withImageView:(UIImageView *)imageView
{
    if (animated) {
        imageView.transform = CGAffineTransformIdentity;

        [UIView animateWithDuration:0.5f animations:^{
            imageView.transform = CGAffineTransformMakeScale(1.5f, 1.5f);
        }];
    }
}