Skip to content

Commit 21cb876

Browse files
authored
fix(iOS): open from available presentedViewController
Check for presentedViewController and present from it. Allow opening from already presented modal. Addresses issue NativeScript#214 and NativeScript#79
1 parent 0e34f31 commit 21cb876

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/imagepicker.ios.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export class ImagePicker extends data_observable.Observable {
2828
}
2929

3030
get hostController() {
31-
return this.hostView ? this.hostView.viewController : UIApplication.sharedApplication.keyWindow.rootViewController;
31+
let vc = this.hostView ? this.hostView.viewController : UIApplication.sharedApplication.keyWindow.rootViewController;
32+
return vc.presentedViewController || vc;
3233
}
3334

3435
constructor(options: Options = {}, hostView: View) {

0 commit comments

Comments
 (0)