gpt4 book ai didi

ios - 在哪些队列中执行 Collection View 的委托(delegate)/数据源方法?

转载 作者:行者123 更新时间:2023-11-28 10:37:09 24 4
gpt4 key购买 nike

我一直假设所有 collectionView/tableView 委托(delegate)/数据源方法都在主队列中执行,只是想验证一下。

最佳答案

任何框架提供的与 UI 相关的东西都在主线程中执行并验证 do

print(Thread.isMainThread)

在任何这些协议(protocol)方法中,你也可以打印

print(Thread.main)
print(Thread.current)

如果匹配则为主线程,否则为另一个线程

关于ios - 在哪些队列中执行 Collection View 的委托(delegate)/数据源方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52958894/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com