Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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);
        }];
    }
}