What is a runloop?
From the literal point of view is the operation of the cycle, in fact, the internal is the Do-while cycle, the loop within the constant processing of various tasks (such as Source,timer,observer)
One thread corresponds to a runloop, the runloop of the main thread is started by default, the runloop of the child thread is started manually (Run method)
Runloop can only select one mode to start, if there is no source,timer,observer in the current mode, then exit directly Runloop
Two how do you use Runloop in the development process? What application scenario?
Open a resident thread (let a child thread not go extinct, wait for messages from other threads, handle other events)
Turn on a timer in a sub-thread
Perform some long-term monitoring in a child thread
Can control the timer to run in a specific mode
Enables certain events (behaviors, tasks) to be performed in a specific mode
You can add observer to monitor the status of the runloop, such as listening for the processing of click events (such as doing some processing before all click events)
What time does the three automatic release tank release?
Release before Runloop sleep (kcfrunloopbeforewaiting)
IOS Runloop Face question