-1

I have a standard UITableViewContoller. You can see the initial position of UITableView.

initial position

You can see an offset when I'm dragging UITableView. Is it possible to find an offset when I'm dragging? I can find an offset when I end drag. How do I find an offset when I'm dragging?

enter image description here

Voloda2
  • 12,359
  • 18
  • 80
  • 130
  • possible duplicate of [Is it possible to add observer to tableView.contentOffset?](http://stackoverflow.com/questions/12087848/is-it-possible-to-add-observer-to-tableview-contentoffset) – Vladimir Aug 23 '12 at 09:14

2 Answers2

0

Because the UITableView is a subclass if UIScrollView, you can simply use the UIScrollViewDelegate protocol on your controller. If it is already the tableview delegate then simply add this protocol, and use the method scrollViewDidScroll:

Every time the user pulls the table down slightly, this method is called. There you can get the content offset as you already do :)

PaReeOhNos
  • 4,338
  • 3
  • 30
  • 41
0

delegate doesn't give much information. Observer is more good solution.

[self.tableView addObserver:self forKeyPath:@"contentOffset" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];

similar topic

Community
  • 1
  • 1
Voloda2
  • 12,359
  • 18
  • 80
  • 130