From 2ad709dae41e8c864463ebc720be4a16ebfea0f2 Mon Sep 17 00:00:00 2001 From: kspearrin Date: Sat, 7 Apr 2018 12:15:59 -0400 Subject: [PATCH] fix ipad crash on doc picker --- src/iOS/Services/DeviceActionService.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/iOS/Services/DeviceActionService.cs b/src/iOS/Services/DeviceActionService.cs index 720b1218e..10df6d9e6 100644 --- a/src/iOS/Services/DeviceActionService.cs +++ b/src/iOS/Services/DeviceActionService.cs @@ -152,6 +152,13 @@ namespace Bit.iOS.Services e.DocumentPicker.DidPickDocument += DocumentPicker_DidPickDocument; }; + var root = UIApplication.SharedApplication.KeyWindow.RootViewController; + if(picker.PopoverPresentationController != null && root != null) + { + picker.PopoverPresentationController.SourceView = root.View; + picker.PopoverPresentationController.SourceRect = root.View.Bounds; + } + controller.PresentViewController(picker, true, null); return Task.FromResult(0); }