How to dispatch code blocks to the same thread in iOS?

前端 未结 8 1695
广开言路
广开言路 2021-01-31 11:04

Main aspect of the question: It\'s about iOS. Can I somehow dispatch code blocks in a way, that they will all (a) run in background and (b) on the same thread?

8条回答
  •  臣服心动
    2021-01-31 11:16

    Create a serial dispatch queue, and dispatch all the calls to that serial dispatch queue. All the calls will be performed in the background, but sequentially on the same thread.

提交回复
热议问题