Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.

Commit 8aa9ad6

Browse files
authored
Don't throw if iOS can't pick multiple files (#1501)
Fixes #1492
1 parent 0782030 commit 8aa9ad6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Xamarin.Essentials/FilePicker/FilePicker.ios.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ public static partial class FilePicker
1313
{
1414
static Task<IEnumerable<FileResult>> PlatformPickAsync(PickOptions options, bool allowMultiple = false)
1515
{
16-
if (allowMultiple && !Platform.HasOSVersion(11, 0))
17-
throw new FeatureNotSupportedException("Multiple file picking is only available on iOS 11 or later.");
18-
1916
var allowedUtis = options?.FileTypes?.Value?.ToArray() ?? new string[]
2017
{
2118
UTType.Content,
@@ -29,7 +26,8 @@ static Task<IEnumerable<FileResult>> PlatformPickAsync(PickOptions options, bool
2926
// while opening (UIDocumentPickerMode.Open) opens the document directly. We do the
3027
// latter, so the user accesses the original file.
3128
var documentPicker = new UIDocumentPickerViewController(allowedUtis, UIDocumentPickerMode.Open);
32-
documentPicker.AllowsMultipleSelection = allowMultiple;
29+
if (Platform.HasOSVersion(11, 0))
30+
documentPicker.AllowsMultipleSelection = allowMultiple;
3331
documentPicker.Delegate = new PickerDelegate
3432
{
3533
PickHandler = urls =>

0 commit comments

Comments
 (0)