diff --git a/Classes/ShareKit/Core/SHK.m b/Classes/ShareKit/Core/SHK.m index 7521b2a8..677b55cc 100644 --- a/Classes/ShareKit/Core/SHK.m +++ b/Classes/ShareKit/Core/SHK.m @@ -107,7 +107,16 @@ - (void)showViewController:(UIViewController *)vc } } - UIView *rootView = [[topWindow subviews] objectAtIndex:0]; + UIView *rootView = nil; + for (UIView *subView in [topWindow subviews]) { + if(strcmp(class_getName([subView class]),"UILayoutContainerView") == 0) { + rootView = subView; + break; + } + } + if (!rootView) { + rootView = [[topWindow subviews] objectAtIndex:0]; + } id nextResponder = [rootView nextResponder]; if ([nextResponder isKindOfClass:[UIViewController class]])