D
D
dimib2014-09-20 22:05:51
iOS
dimib, 2014-09-20 22:05:51

How to write a function that runs every N seconds?

Good day.
Can you please tell me how to design a function that will be executed every N seconds?
________
And yet, if it's not difficult, tell me, is it possible to urgently stop the intermediate animation at the stage of its execution?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
ManWithBear, 2014-09-21
@dimib

Use NSTimer .

D
dimib, 2014-09-21
@dimib

@ManWithBear could you tell me what can be passed to userInfo? I have a parallel repeating method, it is possible to move one object. But as soon as the next "cycle" NSTimer ends, this object moves to its initial position. I understand that object.center is not passed to the next step. How can it be transferred?
Thank you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question