thesamet
thesamet

Reputation: 6582

Creating a quick look style zooming effect

I would like to create an effect than an image zooms up from a thumbnail size to full screen.

I am not sure what's the right steps to achieve this. Should I create a transparent full screen window and animate a layer on top of it?

Upvotes: 1

Views: 363

Answers (2)

Chuck
Chuck

Reputation: 237060

Your solution of a transparent window with a CALayer inside is probably the best supported way to do it.

One thing that seems like it should be a good solution (at least it's the first thing I thought of when I wanted to do this) but isn't is NSView's enterFullScreenMode:withOptions:. If memory serves, it was originally meant to do what you're talking about here, but the animation was taken out and it generally doesn't work that well now.

Upvotes: 1

Matt Ball
Matt Ball

Reputation: 6618

Take a look at this CoreGraphics example. Specifically, take a look at the "grow" and "shrink" animations. That's how Apple does it, and that's what you'll want to do too.

Upvotes: 1

Related Questions