Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Smoke (or) explosion animation while removing an item from my iPhone App

I want to remove an item (lets say a UIButton) from my iPhone application. I want to add some animation when i tap on the button to remove it.

This is the animation i want:

In your OSX dock, if you right-click on an item and tap on *remove from dock*, 
it kinda like **explodes** with a funny noise, and removes itself from that dock.

Any knows how to do that smoke (or) tiny explosion animation on the iPhone ?? Is there a pre-defined name for it ?

like image 587
Legolas Avatar asked Jan 29 '26 11:01

Legolas


1 Answers

Believe it or not, there's an API for exactly that on Mac OS X:

NSPoint centrePoint = ...;
NSSize size = ...;
NSShowAnimationEffect(NSAnimationEffectPoof, centrePoint, size, nil, NULL, NULL);

On iOS, there isn't because the animation is a Mac-specific animation. On iOS, one typically sees the deleted object collapse into a point. That animation can be done by animating the transform of a view (using CAAnimation or the UIView class methods) so that it scales to nothingness.

like image 193
Jonathan Grynspan Avatar answered Jan 31 '26 00:01

Jonathan Grynspan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!