0

What I am trying to do is increase the speed of an NSTimer in swift to increase the speed of a function gradually without making a million different NSTimers. If there is a way to do that, how do you? And if this is not the correct way of doing that, what would the best way be? Thank you.

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

You can destroy the timer and re-create it with a different interval when you want to increase its speed.

You can also have a single timer that runs at the fastest possible interval, and then ignore the callback unless time % some_number == 0 then gradually make some_number smaller and smaller.

i_am_jorf
  • 53,608
  • 15
  • 131
  • 222