Interrupting and Chaining Animations

Discussion in 'iOS Programming' started by 99miles, Feb 5, 2009.

  1. 99miles macrumors member

    Joined:
    Oct 10, 2008
    #1
    I have an app that has a bunch of 'tiles' in it which are just small UIViews. They are all the same. I'm animating them depending on the orientation of the phone.

    Is it recommended to constantly remove any running animations and create new ones when they need to change direction? It's quite a hassle because if I call removeAllAnimations on a tile, then start a new animation, the new animation usually starts before removeAllAnimations has actually cancelled the previous one, which causes the newly started animation to get cancelled.

    I'm thinking about and doing my animations on my own using a Timer, because it seems like I'd have better control of starting and stopping the animations, and changing the durations and destination points on the fly. But, I'm not sure if having that many timers will totally bog down the app. I'll have a maximum of 60 tiles animating at the same time.

    Any thoughts?
    Thanks in advance.
     
  2. CommanderData macrumors regular

    Joined:
    Dec 1, 2007
    #2
    What you really want is only one timer (or better, a thread, but baby steps...) in which you update the positions of *all* of the 60 tiles based on whatever criteria you use currently.
     

Share This Page