mirror of
https://github.com/zhigang1992/ECSlidingViewController.git
synced 2026-03-26 10:14:37 +08:00
Clean up.
This commit is contained in:
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user