Animation inside of a UITableView record

Discussion in 'iPhone/iPad Programming' started by KarlJay, Sep 4, 2012.

  1. macrumors 6502a

    Joined:
    May 1, 2010
    Location:
    California
    #1
    I'm setting up a UITableView similar to Apple's Recipes sample project. I'd like to have either an animated graphic and/or to update the text on the record.

    Think of the image or text as a clock or alarm timer.

    One idea is to set a timer, call an update method that changes the pic and text, then refresh all the displayed records.

    I think I can make that work, but don't know if it's the best approach.

    Is there a way to have an updating text/pic in the records or does this require writing custom code?

    Imagine the Recipes having a clock animation or timer where the food icon is, that's what I'm after.
     
  2. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    UIImageView can animate through an array of images. This is probably the simplest way to do a clock animation.
     
  3. macrumors 68030

    MattInOz

    Joined:
    Jan 19, 2006
    Location:
    Sydney
    #3
    Also it's probably time to look at custom subclass of UITableViewCell.

    The cell should be able to animate on its own without updating the table.
     
  4. macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #4
    Do you want clock hands that spin continuously to indicate that something time-consuming is going on, or do you want to draw a graphical clock face that actually shows time of day, elapsed time, or time remaining.

    If what you want is spinning clock hands that have no relation to the amount of time passing, I agree with the other poster that a UIImageView animation is the way to go.

    If you want clock hands that actually show a meaningful time indicator of some sort, you're going to have to write some fairly complex Core Animation code.
     
  5. thread starter macrumors 6502a

    Joined:
    May 1, 2010
    Location:
    California
    #5
    I'm looking at the second one: a graphical clock face that actually shows time of day, elapsed time, or time remaining.
    Think of 6 alarms/timers that are for different events, basically the stock timer app is for one timer, this would be for several.
    Similar in functionality to this (I don't know if he's got animations or not, the icons all look the same ): http://itunes.apple.com/us/app/multitimer-unlimited-countdowns/id365358824?mt=8
     
  6. macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #6
    I'd probably create a custom control that did this, using Core Graphics, or maybe UIBezierPath objects. It would have a setting for the type of display (count down timer, clock, stopwatch) and take either a time interval or an NSDate, and draw itself based on the setting. I'd then set up a timer that broadcast a notification periodically, and all the clock controls would update themselves when they received that notification.
     

Share This Page