Skip to content
Browse files

Fix beginRefreshing to match the original control. Closes #18

  • Loading branch information...
1 parent 3804905 commit b4152dad093b509996886828d2db84650fd4e46e @Sephiroth87 committed Aug 21, 2012
Showing with 7 additions and 13 deletions.
  1. +7 −13 ODRefreshControl/ODRefreshControl.m
View
20 ODRefreshControl/ODRefreshControl.m
@@ -127,8 +127,7 @@ - (UIActivityIndicatorViewStyle)activityIndicatorViewStyle
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
- if (!self.enabled)
- {
+ if (!self.enabled) {
return;
}
@@ -314,17 +313,12 @@ - (void)beginRefreshing
[_arrowLayer addAnimation:alphaAnimation forKey:nil];
[_highlightLayer addAnimation:alphaAnimation forKey:nil];
- [CATransaction begin];
- [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
- _activity.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1);
- [CATransaction commit];
- [UIView animateWithDuration:0.2 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
- _activity.alpha = 1;
- _activity.layer.transform = CATransform3DMakeScale(1, 1, 1);
- } completion:nil];
- [UIView animateWithDuration:0.4 animations:^{
- [self.scrollView setContentInset:UIEdgeInsetsMake(kOpenedViewHeight, 0, 0, 0)];
- }];
+ _activity.alpha = 1;
+ _activity.layer.transform = CATransform3DMakeScale(1, 1, 1);
+
+ CGPoint offset = self.scrollView.contentOffset;
+ [self.scrollView setContentInset:UIEdgeInsetsMake(kOpenedViewHeight, 0, 0, 0)];
+ [self.scrollView setContentOffset:offset animated:NO];
_refreshing = YES;
_canRefresh = NO;

0 comments on commit b4152da

Please sign in to comment.
Something went wrong with that request. Please try again.