iOS

RunLoop

2019-04-19  本文已影响17人  Code_人生

一、RunLoop是什么?

二、Runloop的作用

  1. 保证线程不退出。
  2. 负责监听所有的事件(iOS中的触摸、时钟、网络事件)
  3. RunLoop负责绘制UI

三、Runloop的item

四、runloop与线程的关系

Runloop:线程.png
  1. 线程 -- runloop -- timer
  2. 子线程runloop 默认不开启
  3. timer 依赖于runloop
RunLoop的金典.png
Runloop结构.png
Runloop机制.png
RunLoop的结构.png
RunLoop的原理.png
上一篇下一篇

猜你喜欢

热点阅读