Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3552] iOS: ScrollView, TableView - Fire event when scroll view `did end decelerating`

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-05-23T14:52:32.000+0000
Affected Version/sn/a
Fix Version/sRelease 2.0.1
ComponentsiOS
Labelsn/a
ReporterJon Alter
AssigneeNeeraj Gupta
Created2011-04-15T03:46:34.000+0000
Updated2017-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];
    }
}

Comments

  1. Lee Morris 2017-03-13

    Closing ticket as fixed.

JSON Source