ios - how to detect when i scrolled below the UITableView AND snaps back -


im atempting facebook type load more data , right works, laggy on device because asking server isnt there already, calling scroll way down function (because somehow when reload data scrolls top). if there way prevent scrolling top great. main thing is, there way detect when scrolled down, , let go (stopped scrolling) in scrolled past have, went possition , calls methods... keeps getting called when scroll greater height of uitableview heres code

-(void)scrollviewdidscroll:(uiscrollview *)scrollview {     cgfloat height = scrollview.frame.size.height;      cgfloat contentyoffset = scrollview.contentoffset.y;      cgfloat distancefrombottom = scrollview.contentsize.height - contentyoffset;      if(distancefrombottom < height)     {         [getmessage removeallobjects];         [self loadmessages];         [self.tableview reloaddata];         [self scrollallthewaydown];     } } 

uiscrollviewdelegate method

- (void)scrollviewdidenddragging:(uiscrollview *)scrollview willdecelerate:(bool)decelerate; 

does want. gets called after user stops scrolling, , can check scrolloffset @ point see if should trigger refresh code. (you'd use scrollviewdidscroll update view show user update happen if lets go)


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -