قالب وردپرس درنا توس
Home / IOS Development / Does anyone know what's going on here? I have configured a UITableView with CollectionView cells, and each of these cells will operate independently, but when I sweep one, it controls another cell that is 3 cells below it. : iOSProgramming

Does anyone know what's going on here? I have configured a UITableView with CollectionView cells, and each of these cells will operate independently, but when I sweep one, it controls another cell that is 3 cells below it. : iOSProgramming



If you have a list of e.g. 100 items, there are only about 4-5 actual instances of cell display (when as large as yours). When you roll one out of the screen, it is recycled and reused instead of instilling 100 different cells and keeping everything in memory. When a new cell is about to appear, it will call cellForRowAtIndexPath, where you probably have the code "tableView.dequeue .." that gets an existing instance (or creates a new one if no one was in line). The cell on the fourth row was the same cell as in the 1st row. In such a situation, you can say "cell.collectionView.contentOffset = .zero" in cellForRow.


Source link