File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ - (UIWindow*) keyWindow {
254254}
255255
256256/* *
257- Find the top view controller that is not of type UINavigationController or UITabBarController
257+ Find the top view controller that is not of type UINavigationController, UITabBarController, UISplitViewController
258258 */
259259- (UIViewController *)topViewController : (UIViewController *)baseViewController {
260260 if ([baseViewController isKindOfClass: [UINavigationController class ]]) {
@@ -265,6 +265,10 @@ - (UIViewController *)topViewController:(UIViewController *)baseViewController {
265265 return [self topViewController: ((UITabBarController *)baseViewController).selectedViewController];
266266 }
267267
268+ if ([baseViewController isKindOfClass: [UISplitViewController class ]]) {
269+ return [self topViewController: ((UISplitViewController *)baseViewController).viewControllers.firstObject];
270+ }
271+
268272 if ([baseViewController presentedViewController ] != nil ) {
269273 return [self topViewController: [baseViewController presentedViewController ]];
270274 }
You can’t perform that action at this time.
0 commit comments