Skip to content

Commit 86d56c2

Browse files
authored
Merge pull request #132 from NativeScript/lini/fix-ios-tab-modal
fix: camera modal displayed under tab view
2 parents 8268275 + 61bb9e6 commit 86d56c2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/camera.ios.ts

+10
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,16 @@ export let takePicture = function (options): Promise<any> {
165165
if (topMostFrame) {
166166
let viewController: UIViewController = topMostFrame.currentPage && topMostFrame.currentPage.ios;
167167
if (viewController) {
168+
while (viewController.parentViewController) {
169+
// find top-most view controler
170+
viewController = viewController.parentViewController;
171+
}
172+
173+
while (viewController.presentedViewController) {
174+
// find last presented modal
175+
viewController = viewController.presentedViewController;
176+
}
177+
168178
viewController.presentViewControllerAnimatedCompletion(imagePickerController, true, null);
169179
}
170180
}

0 commit comments

Comments
 (0)