Enabling UICollectionView prefetch
Hello @ekazaev Firstly, thank you for creating this nice open-source project.
I noticed that isPrefetchingEnabled for the collection view is being blocked in debug mode.
However, it seems that the bug reported at https://openradar.appspot.com/40926834 is not reproducible in the Example app, iOS 17.4.1, and iOS 15.1 environments.
When setting isPrefetchingEnabled to true in the Example app
Attempting to reproduce the reported bug in the Example app
Therefore, I thought it would be beneficial to either remove the preconditionFailure or add isPrefetchingEnabled to CollectionViewChatLayout so that developers can control it, in order to utilize the performance optimization of prefetching.
isPrefetchingEnabled = false
open override func prepare() {
super.prepare()
#if DEBUG
if !isPrefetchingEnabled && collectionView.isPrefetchingEnabled {
preconditionFailure("UICollectionView with prefetching enabled is not supported due to https://openradar.appspot.com/40926834 bug.")
}
#endif
}
If the above direction is okay, I'll try to raise the PR. If there's anything I'm missing, please let me know, thanks.