diff --git a/iphone/Classes/TiUIScrollViewProxy.m b/iphone/Classes/TiUIScrollViewProxy.m index 33f75a7fa79..ae16566b8e1 100644 --- a/iphone/Classes/TiUIScrollViewProxy.m +++ b/iphone/Classes/TiUIScrollViewProxy.m @@ -430,23 +430,36 @@ - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)vi - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { + CGPoint offset = [scrollView contentOffset]; + NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: + NUMFLOAT(offset.x), @"x", + NUMFLOAT(offset.y), @"y", + NUMBOOL([scrollView isDecelerating]), @"decelerating", + [TiUtils sizeToDictionary:scrollView.contentSize], @"contentSize", + nil]; if ([self _hasListeners:@"dragStart"]) { // TODO: Deprecate old event - [self fireEvent:@"dragStart" withObject:nil]; + [self fireEvent:@"dragStart" withObject:dict]; } if ([self _hasListeners:@"dragstart"]) { - [self fireEvent:@"dragstart" withObject:nil]; + [self fireEvent:@"dragstart" withObject:dict]; } } // listerner which tells when dragging ended in the scroll view. - - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { + CGPoint offset = [scrollView contentOffset]; + NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: + NUMFLOAT(offset.x), @"x", + NUMFLOAT(offset.y), @"y", + [NSNumber numberWithBool:decelerate], @"decelerate", nil, + [TiUtils sizeToDictionary:scrollView.contentSize], @"contentSize", + nil]; if ([self _hasListeners:@"dragEnd"]) { // TODO: Deprecate old event - [self fireEvent:@"dragEnd" withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:decelerate], @"decelerate", nil]]; + [self fireEvent:@"dragEnd" withObject:dict]; } if ([self _hasListeners:@"dragend"]) { - [self fireEvent:@"dragend" withObject:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:decelerate], @"decelerate", nil]]; + [self fireEvent:@"dragend" withObject:dict]; } }