[Solved] OS X Dock in an Iphone app?


The Core Animation framework should work fine for the sorts of animations you’re discussing (bouncing, scaling). I think it’ll be a lot easier than OpenGL.

Here is a code snippet which should animate moving an icon to the y coordinate 148 over a 0.2 second duration:

[UIView beginAnimations: @"iconBounce" context: NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(iconBounceAnimationDidStop:finished:context:)];

CGRect iconPosition = iconImageView.frame;
iconPosition.origin.y = 148; //bounce up
iconImageView.frame = iconPosition;

[UIView setAnimationDuration: 0.2];
[UIView commitAnimations];

The selector iconBounceAnimationDidStop:finished:context: represents a method which will be called when the animation completes. You can write that method so that it will move the icon back down to a starting position to complete the bounce.

solved OS X Dock in an Iphone app?