@@ -35,6 +35,7 @@ - (void)underLeftWillAppear;
35
35
- (void )underRightWillAppear ;
36
36
- (void )topDidReset ;
37
37
- (BOOL )topViewHasFocus ;
38
+ - (void )performSelectorOnChildViewControllers : (SEL )selector ;
38
39
39
40
@end
40
41
@@ -390,20 +391,23 @@ - (CGFloat)screenWidthForOrientation:(UIInterfaceOrientation)orientation
390
391
391
392
- (void )underLeftWillAppear
392
393
{
394
+ [self performSelectorOnChildViewControllers: @selector (underLeftWillAppear )];
393
395
self.underRightView .hidden = YES ;
394
396
[self .underLeftViewController viewWillAppear: NO ];
395
397
self.underLeftView .hidden = NO ;
396
398
}
397
399
398
400
- (void )underRightWillAppear
399
401
{
402
+ [self performSelectorOnChildViewControllers: @selector (underRightWillAppear )];
400
403
self.underLeftView .hidden = YES ;
401
404
[self .underRightViewController viewWillAppear: NO ];
402
405
self.underRightView .hidden = NO ;
403
406
}
404
407
405
408
- (void )topDidReset
406
409
{
410
+ [self performSelectorOnChildViewControllers: @selector (topDidReset )];
407
411
[self .topView removeGestureRecognizer: self .resetTapGesture];
408
412
[self removeTopViewSnapshot ];
409
413
self.panGesture .enabled = YES ;
@@ -414,4 +418,14 @@ - (BOOL)topViewHasFocus
414
418
return self.topView .center .x == self.resettedCenter ;
415
419
}
416
420
421
+ - (void )performSelectorOnChildViewControllers : (SEL )selector
422
+ {
423
+ NSArray *childViewControllers = [self childViewControllers ];
424
+ for (UIViewController *childViewController in childViewControllers) {
425
+ if ([childViewController respondsToSelector: selector]) {
426
+ [childViewController performSelector: selector];
427
+ }
428
+ }
429
+ }
430
+
417
431
@end
0 commit comments