views:

1576

answers:

3

I'm looking for tutorials on creating custom view transitions.

In particular, transitions that involve elements other than just the UIViews being affected, such as playing an animation over the transition as it is happening or modifying a screenshot of the UIView being transitioned out.

I don't mean implementing the basic set of transitions (slide, fade, etc) for which there's plenty of examples on Apple's site. I'm talking about adding video/sound/additional animation while wrapping it all in a reusable transition.

I'm vaguely familiar with some of the underlying toolkits (core-animation and quartz) but I'm looking for a no-prior-experience tutorial on the subject.

A: 

Here is a quick guide to using the standard UIView transitions. http://chris-software.com/index.php/dev-center/view-transitions/

If you want to fade into a view use something like this. This works with any type of element with an alpha property, such as UIImageViews, etc. someView.alpha = 0; [viewController.view addSubview:someView];

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.5];
[UIView setAnimationDelegate:self];  
someView.alpha = 1;
[UIView commitAnimations];
Brandon Schlenker
That's not really what I mean by 'custom'. That's pretty basic.I'm looking for something where the view is folded up into a paper airplane and makes zooming noises as it flies off the screen, or a hand reaches in and crumples it and throws it into a wastebasket. Animation, sound, overlaid video...
Sam
+3  A: 

CoreAnimation animations work by recording differences in a very specific subset of UIView properties. They do not respond to any user-defined properties, and simply don't do more advanced transitions than you've already seen in the demos. You could take a screenshot of your current view, save it in memory as a texture, hide the old view and simultaneously show an OpenGL view. Then using the screenshot texture and various mesh animations, you could render your custom transition (including alpha blending around the crumpled/folded edges), then dispose of the OpenGL view to fully reveal the target view. Seems like a fun project, and you'd be in rare company to accomplish it.

jd
This makes a lot of sense. Thanks.Sadly, I probably won't get a chance to implement this - I was just doing research to see how to go about meeting requirements for a contract that fizzled.Hopefully this will be useful for somebody in the future, though.
Sam
+1  A: 

I have just put together a transition class to implement your own animation in OpenGL ES.

Feel free to read about it here

epatel