You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.
I'm refreshing my collectionView whenever a data is supplied by the viewModel.
viewModel.listHomePage.asObservable().subscribe(onNext: { [weak self] responseModel in
if responseModel != nil , let safeSelf = self {
DispatchQueue.main.async {
safeSelf.collectionView.reloadData()
}
}
}).disposed(by: disposeBag)
This observable is fired twice by our app cache mechanism.
First fire is occuring immediately by the latest cached remote server data (if exists),
Second fire is occuring by the network request with the latest remote server data when the request is finished.
When first fire is occured, I see everything is fine, my collection view is there, however when the network request finish and the second fire is occured, the collectionview is suddenly disappearing from the screen, it comes to visible until I physically touch anywhere in the collection view.
When I search if there is a similar issue, I found your reply:
viewModel.listHomePage.asObservable().subscribe(onNext: { [weak self] responseModel in
if responseModel != nil , let safeSelf = self {
DispatchQueue.main.async {
safeSelf.collectionView.reloadData()
safeSelf.collectionView.performBatchUpdates({
safeSelf.influencersCollectionView.collectionViewLayout.invalidateLayout()
})
}
}
}).disposed(by: disposeBag)
Now, when the second fire is occured, I see collectionView refresh itself and in a moment it is going completely and recoming to screen in a very short time. (because we invalidate all layout). It is okey now, but it is still annoying to see collectionview is blinking.
Is it normal to see this problems when the second reloadData called? You have wrote that we don't need to call invalidateLayout anymore, but I'm facing this error if I don't use it, that's why I'm creating this issue.
Thank you.
The text was updated successfully, but these errors were encountered:
Oh I just realised the reason you see blinking is that in the new version (1.0.0)
the alpha layout attribute has been set to 0 until the UICollectionViewCell is loaded. this prevents showing the cell before applying the transforms and effects.
You can disable this by
Hello there,
I'm refreshing my collectionView whenever a data is supplied by the viewModel.
This observable is fired twice by our app cache mechanism.
First fire is occuring immediately by the latest cached remote server data (if exists),
Second fire is occuring by the network request with the latest remote server data when the request is finished.
When first fire is occured, I see everything is fine, my collection view is there, however when the network request finish and the second fire is occured, the collectionview is suddenly disappearing from the screen, it comes to visible until I physically touch anywhere in the collection view.
When I search if there is a similar issue, I found your reply:
#26 (comment)
then, I have changed my code to:
Now, when the second fire is occured, I see collectionView refresh itself and in a moment it is going completely and recoming to screen in a very short time. (because we invalidate all layout). It is okey now, but it is still annoying to see collectionview is blinking.
Is it normal to see this problems when the second reloadData called? You have wrote that we don't need to call invalidateLayout anymore, but I'm facing this error if I don't use it, that's why I'm creating this issue.
Thank you.
The text was updated successfully, but these errors were encountered: