views:

81

answers:

1

How can I create an iPhone in-app screen-saver?

E.g: After 30 seconds the app hasn't been used a "screen-saver" starts. Where screen saver is a movie, a photo slideshow etc.

+2  A: 

You will want to count 30 seconds from any user interaction in this case, so I would suggest having a global NSTimer created in you app delegate that creates and makes prominent your screen saver view if it reaches 30 seconds.

Monitor for touch events and view rotations - if these happen, invalidate your timer and create a new one.

If you don't like the 'create/destroy' aspect of this, you could log a 'last input time' from any touch/rotate event and your timer can compare this to the current time each tick.

davbryn
I think I'll go with the last input time ... sounds a lot better than create/destroy ...
Andrei Stoleru