Snippet: screen snapshot

I have just found this piece of code, great for having in your snippet library. Quick and easy way of doing a screenshot.

After doing this, you can combine it with UIImage+ImageEffects for a nice blur effect.

Pause and resume CABasicAnimations

When I started programming my app I decided not to use any third party game frameworks (like Cocos2D) but native cocoa tools. That means all the animations in my app are done rather using Core Animation or animating some UIView’s properties.

Everything was all right, the 4 mini-games inside the app started to look like proper games. So like every proper game, the user has to be able to pause it. And no, don’t look at the documentation, there is no [myLayer pauseAnimation] nor [myLayer resumeAnimation].

Continue reading