문제

Im currently using a UITableView like any other, and I am researching into the ability to perform a swipe gesture on the screen, which will then shift the contents of the visible table over to display new content

for example: swiping right-to-left on the screen would change (via animation) the contents within each of the cells on screen to show new data.

What I can do is detect a swipe on the cells, or perhaps on the UITableViewController, but what I dont know how to do two fold:

1) Change data in all cells (could you have a set of hidden views within a custom table cell that animate in and out of each cell per swipe?)

2) How can you do this to all cells?

Thanks a lot Mark

도움이 되었습니까?

해결책 2

What I ended up doing was creating a custom table cell which had 3 UIViews inside it, only one of which was visible. Then I iterated over each cell on screen, and animated in and out the appropriate UIView from left to right (or the other way around).

I did not, however, end up using a swipe gesture, too fiddly...

다른 팁

Well you can detect touches providing the following implementation:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

Then to reload you cells, Update your DataSource Array and call

[self.tableView reloadData];

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top