Animation inside of a UITableView record

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

  1. macrumors 6502a

    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


    UIImageView can animate through an array of images. This is probably the simplest way to do a clock animation.
  3. macrumors 68030


    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

    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. macrumors 6502a

    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 ):
  6. macrumors 6502a

    Duncan C

    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