Skip to content

Commit

Permalink
[Catalyst] Add default FilePickerFileTypes (#21689)
Browse files Browse the repository at this point in the history
Co-authored-by: Rui Marinho <[email protected]>
  • Loading branch information
rmarinho and Rui Marinho authored Apr 9, 2024
1 parent d226b48 commit b183cae
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Essentials/src/FilePicker/FilePicker.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,31 +89,36 @@ public partial class FilePickerFileType
static FilePickerFileType PlatformImageFileType() =>
new FilePickerFileType(new Dictionary<DevicePlatform, IEnumerable<string>>
{
{ DevicePlatform.iOS, new[] { (string)UTType.Image } }
{ DevicePlatform.iOS, new[] { (string)UTType.Image } },
{ DevicePlatform.MacCatalyst, new[] { (string)UTType.Image } }
});

static FilePickerFileType PlatformPngFileType() =>
new FilePickerFileType(new Dictionary<DevicePlatform, IEnumerable<string>>
{
{ DevicePlatform.iOS, new[] { (string)UTType.PNG } }
{ DevicePlatform.iOS, new[] { (string)UTType.PNG } },
{ DevicePlatform.MacCatalyst, new[] { (string)UTType.PNG } }
});

static FilePickerFileType PlatformJpegFileType() =>
new FilePickerFileType(new Dictionary<DevicePlatform, IEnumerable<string>>
{
{ DevicePlatform.iOS, new[] { (string)UTType.JPEG } }
{ DevicePlatform.iOS, new[] { (string)UTType.JPEG } },
{ DevicePlatform.MacCatalyst, new[] { (string)UTType.JPEG } }
});

static FilePickerFileType PlatformVideoFileType() =>
new FilePickerFileType(new Dictionary<DevicePlatform, IEnumerable<string>>
{
{ DevicePlatform.iOS, new string[] { UTType.MPEG4, UTType.Video, UTType.AVIMovie, UTType.AppleProtectedMPEG4Video, "mp4", "m4v", "mpg", "mpeg", "mp2", "mov", "avi", "mkv", "flv", "gifv", "qt" } }
{ DevicePlatform.iOS, new string[] { UTType.MPEG4, UTType.Video, UTType.AVIMovie, UTType.AppleProtectedMPEG4Video, "mp4", "m4v", "mpg", "mpeg", "mp2", "mov", "avi", "mkv", "flv", "gifv", "qt" } },
{ DevicePlatform.MacCatalyst, new string[] { UTType.MPEG4, UTType.Video, UTType.AVIMovie, UTType.AppleProtectedMPEG4Video, "mp4", "m4v", "mpg", "mpeg", "mp2", "mov", "avi", "mkv", "flv", "gifv", "qt" } }
});

static FilePickerFileType PlatformPdfFileType() =>
new FilePickerFileType(new Dictionary<DevicePlatform, IEnumerable<string>>
{
{ DevicePlatform.iOS, new[] { (string)UTType.PDF } }
{ DevicePlatform.iOS, new[] { (string)UTType.PDF } },
{ DevicePlatform.MacCatalyst, new[] { (string)UTType.PDF } }
});
#pragma warning restore CA1422 // Validate platform compatibility
#pragma warning restore CA1416
Expand Down

0 comments on commit b183cae

Please sign in to comment.