Skip to content

Commit 8921914

Browse files
committed
Add notification for top will reset
1 parent 2bd7916 commit 8921914

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ extern NSString *const ECSlidingViewTopDidAnchorLeft;
2727
/** Notification that gets posted when the top view is anchored to the right side of the screen */
2828
extern NSString *const ECSlidingViewTopDidAnchorRight;
2929

30+
/** Notification that gets posted when the top view will be centered on the screen */
31+
extern NSString *const ECSlidingViewTopWillReset;
32+
3033
/** Notification that gets posted when the top view is centered on the screen */
3134
extern NSString *const ECSlidingViewTopDidReset;
3235

ECSlidingViewController/Vendor/ECSlidingViewController/ECSlidingViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
NSString *const ECSlidingViewUnderRightWillDisappear = @"ECSlidingViewUnderRightWillDisappear";
1515
NSString *const ECSlidingViewTopDidAnchorLeft = @"ECSlidingViewTopDidAnchorLeft";
1616
NSString *const ECSlidingViewTopDidAnchorRight = @"ECSlidingViewTopDidAnchorRight";
17+
NSString *const ECSlidingViewTopWillReset = @"ECSlidingViewTopWillReset";
1718
NSString *const ECSlidingViewTopDidReset = @"ECSlidingViewTopDidReset";
1819

1920
@interface ECSlidingViewController()
@@ -358,6 +359,9 @@ - (void)anchorTopViewOffScreenTo:(ECSide)side animations:(void(^)())animations o
358359

359360
- (void)resetTopView
360361
{
362+
dispatch_async(dispatch_get_main_queue(), ^{
363+
[[NSNotificationCenter defaultCenter] postNotificationName:ECSlidingViewTopWillReset object:self userInfo:nil];
364+
});
361365
[self resetTopViewWithAnimations:nil onComplete:nil];
362366
}
363367

0 commit comments

Comments
 (0)