I’ve been created custom cell named CustomCell with UIVIew class reference and interface with UITableViewCell reference named SlidingCustomCell. In this interface I call CustomCell interface.
I’d like to slide cell when slide event is appeared. To do this I’ve been created in interface SlidinCustomCell method:
-(void)touchesMoved
with simple code
CGRect frame = cellGroup.frame;
frame.origin = CGPointMake(100, 0);
cellGroup.frame = frame;
When I slide first cell everything looks fine, until I scroll down and see that the 9th cell was automatically slided without my interaction. This error occurs for each slided cell. (1. cell auto slides 9. cell, 2. cell auto slides 10.cell etc. ). I’ve got created 20 table cells.
The reason your other cells are being slid over is because they’re being reused in
You’ll want to set a variable in your model to mark when each cell is slid over. Then check every time a cell is created to see if this item actually needs to be slid.
Something like this.