0

I have a graph which is 10 times the width of the iphone screen. I want to scroll it automatically a fixed number of points (for instance 0.01) every 0.2 seconds. I want the animation to stop when a user presses a pause button and to pick up from last position when he taps resume button.

Is it something that can be achieved with Core Animation? Or is it something that you need to do manually using drawRect?

mgamer
  • 13,580
  • 25
  • 87
  • 145
  • 1
    Is the graph in an UIView? You can draw into a UIView, placed in a UIScrollView, and then use UIScrollView's setContentOffset:animated: method (or UIView's animate methods) to adjust the contentOffset gradually. Does that help? – clearwater82 Oct 29 '12 at 20:59
  • Perhaps you are misunderstanding the purpose of both Core Animation, and the `-drawRect:` method. There are simpler means of going about this. – CodaFi Oct 29 '12 at 22:09

1 Answers1

0

Put the graph on a scroll view and use NSTimer to control the content offset. If you want to pause, just invalidate the timer

Oscar
  • 651
  • 5
  • 13