[英]Swift - beginInteractiveMovementForItem on iOS 16
on iOS 16 beginInteractiveMovementForItem in collectionvView 抛出错误:
attempt to insert nil object from objects[0]' terminating with uncaught exception of type NSException
这是我的代码:
collectionView.beginInteractiveMovementForItem(at: selectedIndexPath)
iOS 16 有没有其他选择可以使用? 这里还有一个类似的问题: UICollectionView 在 iOS 16 beta 上移动项目时崩溃,但仍然没有解决这个问题。
只需添加一个延迟,它现在也可以在 iOS 16 上运行。
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
collectionView.beginInteractiveMovementForItem(at: selectedIndexPath)
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.