diff --git a/src/MediaPicker/MediaPicker.ios.cs b/src/MediaPicker/MediaPicker.ios.cs index 7c5122a..70d2288 100644 --- a/src/MediaPicker/MediaPicker.ios.cs +++ b/src/MediaPicker/MediaPicker.ios.cs @@ -65,7 +65,11 @@ static async Task PhotoAsync(MediaPickerOptions options, bool photo, var tcs = new TaskCompletionSource(picker); picker.Delegate = new PhotoPickerDelegate { - CompletedHandler = info => GetFileResult(info, tcs) + CompletedHandler = async info => + { + GetFileResult(info, tcs); + await vc.DismissViewControllerAsync(true); + } }; if (picker.PresentationController != null) @@ -80,8 +84,6 @@ static async Task PhotoAsync(MediaPickerOptions options, bool photo, var result = await tcs.Task; - await vc.DismissViewControllerAsync(true); - picker?.Dispose(); picker = null;