0

I've no experience in making something move in my app. And I observed this effect in Flickit Pro. The Tap for details view will shake for one or two second and then stop. It looks cute and very user-friendly.

So how can I make effects like this? A gif that is moving? Or some other methods with the help of Cocoa Touch?

Thanks in advance.

Di

alt text

Di Wu
  • 6,436
  • 3
  • 35
  • 51

2 Answers2

3

A high-level way would be [UIView beginAnimations: context:] (where both parameters can be NULL in this simple case). Then you can just change the properties that want to change of the view that should be animated, add some other "effects" like ease-in/out, etc. pp. When you are done with this, you just call [UIView commitAnimations] and it will animate everything for you.

However, in the case that you need more freedom, look into the CAAnimation class (its inside the QuartzCore framework).

Also: Look into the documentation for both ways (UIView / CAAnimation) and look into session 424 and 425 of the 2010 WWDC.

JustSid
  • 25,168
  • 7
  • 79
  • 97
2

There are already some answers on stackoverflow on this:

Shake visual effect on iPhone (NOT shaking the device)

UIView shake animation

how to create iphone's wobbling icon effect?

and here is a link that does it on mac:

http://www.cimgf.com/2008/02/27/core-animation-tutorial-window-shake-effect/

I hope these are enough links to help.

Community
  • 1
  • 1
Madhup Singh Yadav
  • 8,110
  • 7
  • 51
  • 84