gpt4 book ai didi

ios - UITableView "beginUpdates"和 UICollectionView "performBatchUpdates"是否具有相同的行为?

转载 作者:IT王子 更新时间:2023-10-29 08:14:56 27 4
gpt4 key购买 nike

我在浏览文档时开始怀疑 UITableView 中的“beginUpdates”和 UICollectionView 中的“performBatchUpdates”是否具有相同的行为。如果是这样,是否有理由将它们称为不同的,即使它们实际上是相同的东西?

谢谢!

最佳答案

UITableViewbeginUpdates 必须与对 endUpdates 的调用匹配。 UICollectionViewperformBatchUpdates:completion 方法不需要您在进行更新时回调到 Collection View ,大概是因为您传入的工作 block 更新 Collection View 包含在这些调用中。

UITableView 早于将 block 添加到 Objective-C。我怀疑 UITableView 没有类似 API 的原因是它的公共(public) API 是在可以合并 block 之前设计的。

关于ios - UITableView "beginUpdates"和 UICollectionView "performBatchUpdates"是否具有相同的行为?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25125601/

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