Skip to content

Commit

Permalink
fix: camera modal displayed under tab view
Browse files Browse the repository at this point in the history
related to #128
  • Loading branch information
lini committed Oct 23, 2018
1 parent 8268275 commit 61bb9e6
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 61bb9e6

Please sign in to comment.