dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

iOS-Specific enum UIModalPresentationStyle does not support all underlying UIKit options #23975

Open piersdeseilligny opened 3 months ago

piersdeseilligny commented 3 months ago

Description

UIModalPresentationStyle is an iOS Specific enum, which can be used to specify the visual appearance of modal pages.

It can be set on any modal page with On<iOS>().SetModalPresentationStyle(Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.FormSheet);.

However, it's missing several options which are available in Apple's documentation, most notably:

BlurOverFullScreen seems like it'd be a very easy plug and play addition. Popover would be a bit more involved, as it'd require the user to then access the automatically created UIPopoverController as outlined in apple's documentation in order to specify where it's originating from

However as far as I can tell, this would all be achievable without any additional helper methods from maui, so the only thing required to make all of this work are some very minor changes to:

Public API Changes

Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.Popover
Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.BlurOverFullScreen

Intended Use-Case

I have an application for which a modal would best work as a popover on iOS and macOS, and would help make the application feel more native.

jfversluis commented 3 months ago

Thanks for the great description of this issue! I don't think this will be a priority for us in the near future. If you're willing to look into it we might be able to review it and get it in that way if it isn't too big of a change.

piersdeseilligny commented 3 months ago

Thanks for the response @jfversluis ! As expected it was pretty easy to add, so I've submitted a PR which adds support for this.