Skip to content

Commit

Permalink
Merge pull request #132 from NativeScript/lini/fix-ios-tab-modal
Browse files Browse the repository at this point in the history
fix: camera modal displayed under tab view
  • Loading branch information
lini authored Oct 24, 2018
2 parents 8268275 + 61bb9e6 commit 86d56c2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/camera.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ export let takePicture = function (options): Promise<any> {
if (topMostFrame) {
let viewController: UIViewController = topMostFrame.currentPage && topMostFrame.currentPage.ios;
if (viewController) {
while (viewController.parentViewController) {
// find top-most view controler
viewController = viewController.parentViewController;
}

while (viewController.presentedViewController) {
// find last presented modal
viewController = viewController.presentedViewController;
}

viewController.presentViewControllerAnimatedCompletion(imagePickerController, true, null);
}
}
Expand Down

0 comments on commit 86d56c2

Please sign in to comment.