From a85257f26cd7858ecbc678bf3043ed8b305faf45 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 6 Nov 2020 03:23:10 +0200 Subject: [PATCH 1/2] Don't throw if iOS can't pick multiple files Fixes #1492 --- Xamarin.Essentials/FilePicker/FilePicker.ios.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Xamarin.Essentials/FilePicker/FilePicker.ios.cs b/Xamarin.Essentials/FilePicker/FilePicker.ios.cs index 9dff9ab0f..b95e98fa7 100644 --- a/Xamarin.Essentials/FilePicker/FilePicker.ios.cs +++ b/Xamarin.Essentials/FilePicker/FilePicker.ios.cs @@ -13,8 +13,7 @@ public static partial class FilePicker { static Task> PlatformPickAsync(PickOptions options, bool allowMultiple = false) { - if (allowMultiple && !Platform.HasOSVersion(11, 0)) - throw new FeatureNotSupportedException("Multiple file picking is only available on iOS 11 or later."); + throw new FeatureNotSupportedException("Multiple file picking is only available on iOS 11 or later."); var allowedUtis = options?.FileTypes?.Value?.ToArray() ?? new string[] { @@ -29,7 +28,8 @@ static Task> PlatformPickAsync(PickOptions options, bool // while opening (UIDocumentPickerMode.Open) opens the document directly. We do the // latter, so the user accesses the original file. var documentPicker = new UIDocumentPickerViewController(allowedUtis, UIDocumentPickerMode.Open); - documentPicker.AllowsMultipleSelection = allowMultiple; + if (Platform.HasOSVersion(11, 0)) + documentPicker.AllowsMultipleSelection = allowMultiple; documentPicker.Delegate = new PickerDelegate { PickHandler = urls => From 49a6d2e92d44cd311ba0c5ef6d680b71a81a6992 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 6 Nov 2020 04:30:32 +0200 Subject: [PATCH 2/2] Update FilePicker.ios.cs --- Xamarin.Essentials/FilePicker/FilePicker.ios.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Xamarin.Essentials/FilePicker/FilePicker.ios.cs b/Xamarin.Essentials/FilePicker/FilePicker.ios.cs index b95e98fa7..e38f66d0d 100644 --- a/Xamarin.Essentials/FilePicker/FilePicker.ios.cs +++ b/Xamarin.Essentials/FilePicker/FilePicker.ios.cs @@ -13,8 +13,6 @@ public static partial class FilePicker { static Task> PlatformPickAsync(PickOptions options, bool allowMultiple = false) { - throw new FeatureNotSupportedException("Multiple file picking is only available on iOS 11 or later."); - var allowedUtis = options?.FileTypes?.Value?.ToArray() ?? new string[] { UTType.Content,