ios - Reordering UITableView without reorder control -
i need user able reorder uitableview way: touches cell predetermined period (e.g. 1 second), can drag , drop on other cells.
i know how implement 'long touch' detection using gesture recognizer, best way implement drag , drop ability without using reorder control (the user should drag cell anywhere in cell, not reorder control)?
i solved question of following steps:
- attach gesture recognizer uitableview.
- detect cell tapped "long touch". @ moment create snapshot of selected cell, put uiimageview , place on uitableview. uiimageview's coordinates should math selected cell relative uitableview (snapshot of selected cell should overlay selected cell).
- store index of selected cell, delete selected cell , reload uitableview.
- disable scrolling uitableview. need change frame of snapshot uiimageview when drag cell. can in
touchesmovedmethod. - create new cell , reload uitableview (you have stored index) when user finger leaves screen.
- remove snapshot uiimageview.
but not easy it.
Comments
Post a Comment