[TIMOB-3552] iOS: ScrollView, TableView - Fire event when scroll view `did end decelerating`
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-05-23T14:52:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 2.0.1 |
Components | iOS |
Labels | n/a |
Reporter | Jon Alter |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:46:34.000+0000 |
Updated | 2017-03-13T20:29:08.000+0000 |
Description
Requesting that the scrollView and tableView event "scrollViewDidEndDecelerating" be exposed.
For example, fire "scrollFinished" event so that we know where we are after the scroll
stopped:
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
// resume image loader when we're done scrolling
[[ImageLoader sharedLoader] resume];
if ([self.proxy _hasListeners:@"scrollFinished"])
{
NSMutableDictionary *event = [NSMutableDictionary dictionary];
[event setObject:[TiUtils pointToDictionary:scrollView.contentOffset] forKey:@"contentOffset"];
[event setObject:[TiUtils sizeToDictionary:scrollView.contentSize] forKey:@"contentSize"];
[event setObject:[TiUtils sizeToDictionary:tableview.bounds.size] forKey:@"size"];
[self.proxy fireEvent:@"scrollFinished" withObject:event];
}
}
Closing ticket as fixed.