iPad: popup view out of another view
For one of my projects on the iPad I wanted to popup a detail window out of an existing image view, using some animation while popping up. CoreAnimation was the way to go, but I was facing difficulties to:
a) find out how to do it and
b) get it working.
The animation should combine movement (from the location of the clicked image to the location where the popup is shown), scaling (from the image size to the popup size) and rotation (for a nice effect). Google searches delivered bits and pieces, the best sample I found was MFFlip from Mike Lee. This didn’t include scaling and movement like I wanted it, so I added this and then packed it up nicely into a single class ViewFlipper with a single factory method that takes 2 views as parameters and does all the calculations and animation. The ViewFlipper class can be included without further dependencies into any project, except that you need to include the QuartzCore framework.
I’ve created a little sample iPad program around it that you can download here. I’ve put some documentation in the code that describes the what goes on inside. I hope this is useful for others who are struggling with this too.
Note: initially I kept having trouble with all of the examples I found, it turned out this was caused by the fact that I had one view with 3 subviews: a UITableView covering the entire view, the imageView and popupView (which were shown above the UITableView). I managed to solve this by moving the imageView and popupView onto a view of its own. I gave this extra view a transparent background, so that the underlying UITableView was still visible. This extra view also has the advantage that you can catch touch events on it which you can use to popdown the popup.
Today version 1.2.3 of