mirror of
https://github.com/zhigang1992/ECSlidingViewController.git
synced 2026-04-23 12:56:59 +08:00
Callbacks for child views:
- (void)underLeftWillAppear - (void)underRightWillAppear - (void)topDidReset
This commit is contained in:
@@ -30,4 +30,20 @@
|
||||
[self.slidingViewController anchorTopViewTo:ECRight animations:nil onComplete:nil];
|
||||
}
|
||||
|
||||
// callbacks from slidingViewController
|
||||
- (void)underLeftWillAppear
|
||||
{
|
||||
NSLog(@"under left will appear");
|
||||
}
|
||||
|
||||
- (void)underRightWillAppear
|
||||
{
|
||||
NSLog(@"under right will appear");
|
||||
}
|
||||
|
||||
- (void)topDidReset
|
||||
{
|
||||
NSLog(@"top did reset");
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
- (void)underRightWillAppear;
|
||||
- (void)topDidReset;
|
||||
- (BOOL)topViewHasFocus;
|
||||
- (void)performSelectorOnChildViewControllers:(SEL)selector;
|
||||
|
||||
@end
|
||||
|
||||
@@ -390,6 +391,7 @@
|
||||
|
||||
- (void)underLeftWillAppear
|
||||
{
|
||||
[self performSelectorOnChildViewControllers:@selector(underLeftWillAppear)];
|
||||
self.underRightView.hidden = YES;
|
||||
[self.underLeftViewController viewWillAppear:NO];
|
||||
self.underLeftView.hidden = NO;
|
||||
@@ -397,6 +399,7 @@
|
||||
|
||||
- (void)underRightWillAppear
|
||||
{
|
||||
[self performSelectorOnChildViewControllers:@selector(underRightWillAppear)];
|
||||
self.underLeftView.hidden = YES;
|
||||
[self.underRightViewController viewWillAppear:NO];
|
||||
self.underRightView.hidden = NO;
|
||||
@@ -404,6 +407,7 @@
|
||||
|
||||
- (void)topDidReset
|
||||
{
|
||||
[self performSelectorOnChildViewControllers:@selector(topDidReset)];
|
||||
[self.topView removeGestureRecognizer:self.resetTapGesture];
|
||||
[self removeTopViewSnapshot];
|
||||
self.panGesture.enabled = YES;
|
||||
@@ -414,4 +418,14 @@
|
||||
return self.topView.center.x == self.resettedCenter;
|
||||
}
|
||||
|
||||
- (void)performSelectorOnChildViewControllers:(SEL)selector
|
||||
{
|
||||
NSArray *childViewControllers = [self childViewControllers];
|
||||
for (UIViewController *childViewController in childViewControllers) {
|
||||
if ([childViewController respondsToSelector:selector]) {
|
||||
[childViewController performSelector:selector];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user