|
8 | 8 |
|
9 | 9 | #import "ECSlidingViewController.h"
|
10 | 10 |
|
11 |
| -NSString *const ECSlidingViewUnderRightWillAppear = @"ECSlidingViewUnderRightWillAppear"; |
12 |
| -NSString *const ECSlidingViewUnderLeftWillAppear = @"ECSlidingViewUnderLeftWillAppear"; |
13 |
| -NSString *const ECSlidingViewTopDidAnchorLeft = @"ECSlidingViewTopDidAnchorLeft"; |
14 |
| -NSString *const ECSlidingViewTopDidAnchorRight = @"ECSlidingViewTopDidAnchorRight"; |
15 |
| -NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidReset"; |
| 11 | +NSString *const ECSlidingViewUnderRightWillAppear = @"ECSlidingViewUnderRightWillAppear"; |
| 12 | +NSString *const ECSlidingViewUnderLeftWillAppear = @"ECSlidingViewUnderLeftWillAppear"; |
| 13 | +NSString *const ECSlidingViewUnderLeftWillDisappear = @"ECSlidingViewUnderLeftWillDisappear"; |
| 14 | +NSString *const ECSlidingViewUnderRightWillDisappear = @"ECSlidingViewUnderRightWillDisappear"; |
| 15 | +NSString *const ECSlidingViewTopDidAnchorLeft = @"ECSlidingViewTopDidAnchorLeft"; |
| 16 | +NSString *const ECSlidingViewTopDidAnchorRight = @"ECSlidingViewTopDidAnchorRight"; |
| 17 | +NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidReset"; |
16 | 18 |
|
17 | 19 | @interface ECSlidingViewController()
|
18 | 20 |
|
@@ -408,8 +410,22 @@ - (void)updateTopViewHorizontalCenter:(CGFloat)newHorizontalCenter
|
408 | 410 |
|
409 | 411 | - (void)topViewHorizontalCenterWillChange:(CGFloat)newHorizontalCenter
|
410 | 412 | {
|
| 413 | + |
| 414 | + |
411 | 415 | CGPoint center = self.topView.center;
|
412 | 416 |
|
| 417 | + if (center.x >= self.resettedCenter && newHorizontalCenter == self.resettedCenter) { |
| 418 | + dispatch_async(dispatch_get_main_queue(), ^{ |
| 419 | + [[NSNotificationCenter defaultCenter] postNotificationName:ECSlidingViewUnderLeftWillDisappear object:self userInfo:nil]; |
| 420 | + }); |
| 421 | + } |
| 422 | + |
| 423 | + if (center.x <= self.resettedCenter && newHorizontalCenter == self.resettedCenter) { |
| 424 | + dispatch_async(dispatch_get_main_queue(), ^{ |
| 425 | + [[NSNotificationCenter defaultCenter] postNotificationName:ECSlidingViewUnderRightWillDisappear object:self userInfo:nil]; |
| 426 | + }); |
| 427 | + } |
| 428 | + |
413 | 429 | if (center.x <= self.resettedCenter && newHorizontalCenter > self.resettedCenter) {
|
414 | 430 | [self underLeftWillAppear];
|
415 | 431 | } else if (center.x >= self.resettedCenter && newHorizontalCenter < self.resettedCenter) {
|
|
0 commit comments