diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2017-05-02 14:07:57 -0700 |
---|---|---|
committer | Jordan Kiley <jmkiley@users.noreply.github.com> | 2017-05-02 14:07:57 -0700 |
commit | e5ae80ca9648032298eddfc7032c11bc02a3c534 (patch) | |
tree | f2ff2ec806681aa77f388dd2e58a7de5545906d7 /platform/ios/src/UIViewController+MGLAdditions.m | |
parent | 5c52401d5504ab4b84d1510042c6b97504c50933 (diff) | |
download | qtlocation-mapboxgl-e5ae80ca9648032298eddfc7032c11bc02a3c534.tar.gz |
[ios] properly show attribution in modal hierarchies (#8837)
fixes #8782
Diffstat (limited to 'platform/ios/src/UIViewController+MGLAdditions.m')
-rw-r--r-- | platform/ios/src/UIViewController+MGLAdditions.m | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/platform/ios/src/UIViewController+MGLAdditions.m b/platform/ios/src/UIViewController+MGLAdditions.m new file mode 100644 index 0000000000..746fdd8db8 --- /dev/null +++ b/platform/ios/src/UIViewController+MGLAdditions.m @@ -0,0 +1,22 @@ +#import "UIViewController+MGLAdditions.h" + +@implementation UIViewController (MGLAdditions) + +- (UIViewController *)mgl_topMostViewController +{ + if ([self isKindOfClass:[UINavigationController class]]) + { + return [[(UINavigationController *)self visibleViewController] mgl_topMostViewController]; + } + else if ([self isKindOfClass:[UITabBarController class]]) + { + return [[(UITabBarController *)self selectedViewController] mgl_topMostViewController]; + } + else if (self.presentedViewController) + { + return [self.presentedViewController mgl_topMostViewController]; + } + return self; +} + +@end |