How to execute a method in the view controller every x milliseconds?

How to execute a method in the view controller every x milliseconds?

+3
source share
1 answer

Create a timer that takes your view and function as called arguments. Alternatively, you can use NSInvocation with NSTimer.

eg.

[NSTimer scheduledTimerWithTimeInterval:0.1f target:myView selector:@selector(myMethod) userInfo:nil repeats:YES];
+7
source

Source: https://habr.com/ru/post/1703319/


All Articles