Specify to call someting when main thread is idle

Solutions Collect From Internet About “Specify to call someting when main thread is idle”

You can use GCD to schedule a task with low priority in the main queue.

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
      //Your code here
});

You can put this code within a loop, timer or whatever you want.