簡體   English   中英

Swift - beginInteractiveMovementForItem on iOS 16

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM