-3

Can anyone please guide me how can i achieve ios app animation ?

What kind of view controller, objects and implementation required ?

Thanks

Tariq
  • 9,861
  • 12
  • 62
  • 103

3 Answers3

5

You shoud have:

  • a root UIScrollView
  • a programmatically-created UIView for every icon
  • to iterate through the icons use [root subviews]
  • an animation function shakeView:(UIView *)paramView that adds the delete icon and starts shaking the icon
  • a global bool isShaking to have the state of the screen

Use touchesBegan to detect the view that is clicked/selected and the type of touch

That about sums it up. Try to create a maximum amount of elements programmatically.

Stefan Ticu
  • 2,093
  • 1
  • 12
  • 21
  • Are you sure each icon should be its own UIView? It would be more lightweight to have a CALayer for each icon and then assign the `CGImageRef` of the icon to each layer. But as usual, one has to profile it, if it is worth the optimization. – GorillaPatch Apr 07 '11 at 09:12
  • It's the structure I used and it works flowlessly on iPhone 3G and higher. – Stefan Ticu Apr 07 '11 at 09:21
  • Thanks for the comment. I asked because on the mac a `NSView` is quite a hefty class which could lead to performance degradation. In UIKit `UIView` is obviously much more resource friendly. – GorillaPatch Apr 07 '11 at 09:23
2

There is no harm if you take a look at this:

Move UIViews to avoid collision like rearranging icons on Springboard

check Kristopher Johnson Answer.

Community
  • 1
  • 1
Ahmad Kayyali
  • 8,233
  • 13
  • 49
  • 83
  • @Tariq- iPHONE Programmer: I am glad that i could "partially" help, i will keeping looking though because it will benefit everyone in this community = ) – Ahmad Kayyali Apr 07 '11 at 09:25
1

Unfortunately Apple doesn't provide a GridView Class, but you can use the very handy TTLauncherView from Three20 that implements all the default behaviour for you:

https://github.com/facebook/three20

From their website http://three20.info/

Three20 is a open source Objective-C library used by dozens of well-known brands in the App Store, including Facebook, Posterous, Pulse, Meetup.com, and SCVNGR. Three20 provides powerful view controllers such as the Launcher, the popular Photo Browser, and internet-aware tables.

ludwigschubert
  • 662
  • 6
  • 14