Closed Banck closed 6 years ago
This is weird, can you provide more code. What presenter are you using. what kind of data source are you using?
@lkzhao Seems, I resolved this issue. I have datasource:
dataSource = ArrayDataSource(data: presenter!.matches, identifierMapper: { (index, data) -> String in
return "\(data.id ?? 0)"
})
and when I want to create empty cell my data.id nil. So all cells had identifier == 0. And then when I call dataSource.data.removeAll() some cells still on the screen.
Now I have dataSource:
dataSource = ArrayDataSource(data: presenter!.matches, identifierMapper: { (index, data) -> String in
return "\(data.id ?? index)"
})
and all is fine.
@Banck Thanks for reporting. It shouldn't leave the cells on screen even if there are identifier conflicts. I will push a patch to fix this issue in next week. Please leave this open for now.
Hello! I've tried to create dummyCells and showing it, for example, first 5 sec and then clear collectionView and show real cells. But when I set new data some cells didn't remove from collectionView even I set empty array to dataSource:
and after sometime call:
dataSource.data = matches
And on the screen I can see 2 empty cells and bellow them real cells: http://joxi.ru/D2P6pJspD1XQr3 http://joxi.ru/xAe8abupz6aY2yIf I call
dataSource.data.removeAll()
On the screen I can see 2 cells. I've debugged and dataSource.data.count == 0.