iPhone “slide to unlock” animation

前端 未结 13 826
感情败类
感情败类 2020-11-28 00:49

Any ideas as to how Apple implemented the \"slide to unlock\" (also, \"slide to power off\" is another identical example) animation?

I thought about some sort of ani

13条回答
  •  悲哀的现实
    2020-11-28 01:30

    Thanks to rpetrich for the clipping gradient recipe. I am a newbie iPhone and Cocoa developer, so I was real happy to find it.

    I've implemented a decent-looking Slide to Cancel UIViewController using rpetrich's method. You can download the Xcode project of my implementation from here.

    My implementation uses a repeating NSTimer. I was unable to figure out how use Core (or Gore) Animation to have the iPhone's graphics engine continuously move the highlighting. I think that could be done on OS X with CALayer mask layers, but mask layers are not supported on iPhone OS.

    When I play with Apple's "Slide to Unlock" slider on my iPhone's home screen, I occasionally see the animation freeze. So I think Apple may be using a timer as well.

    If anyone can figure out how to do a non-timer based implementation using CA or OpenGL, I would love to see it.

    Thanks for the help!

提交回复
热议问题