Clean up.

This commit is contained in:
Kyle Fang
2013-06-09 00:31:00 +08:00
parent e06a8a0284
commit e3ca79ede4
2 changed files with 8 additions and 8 deletions

View File

@@ -27,8 +27,9 @@
[self.slidingViewController setAnchorRightRevealAmount:280.0f];
self.slidingViewController.underLeftWidthLayout = ECFullWidth;
__weak typeof(self) weakSelf = self;
self.slidingViewController.continuousBlock = ^(float x){
self.tableView.frame = CGRectInset(self.originalViewRect, (280.f-x) / 10, (280.f-x) / 10);
weakSelf.tableView.frame = CGRectInset(self.originalViewRect, (280.f-x) / 10, (280.f-x) / 10);
};
}

View File

@@ -256,9 +256,9 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidRese
CGFloat panAmount = self.initialTouchPositionX - currentTouchPositionX;
CGFloat newCenterPosition = self.initialHoizontalCenter - panAmount;
if (self.continuousBlock) {
self.continuousBlock(fabs(newCenterPosition - self.resettedCenter));
}
if (self.continuousBlock) {
self.continuousBlock(fabs(newCenterPosition - self.resettedCenter));
}
if ((newCenterPosition < self.resettedCenter && (self.anchorLeftTopViewCenter == NSNotFound || self.underRightViewController == nil)) ||
(newCenterPosition > self.resettedCenter && (self.anchorRightTopViewCenter == NSNotFound || self.underLeftViewController == nil))) {
@@ -313,9 +313,9 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidRese
animations();
}
[self updateTopViewHorizontalCenter:newCenter];
if (self.continuousBlock) {
self.continuousBlock(fabs(newCenter - self.resettedCenter));
}
if (self.continuousBlock) {
self.continuousBlock(fabs(newCenter - self.resettedCenter));
}
} completion:^(BOOL finished){
if (_resetStrategy & ECPanning) {
self.panGesture.enabled = YES;
@@ -454,7 +454,6 @@ NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidRese
- (void)topViewHorizontalCenterDidChange:(CGFloat)newHorizontalCenter
{
NSLog(@"%g", newHorizontalCenter);
if (newHorizontalCenter == self.resettedCenter) {
[self topDidReset];
}