maui icon indicating copy to clipboard operation
maui copied to clipboard

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

Open piersdeseilligny opened this issue 1 year ago • 2 comments

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:

  • Popover
  • BlurOverFullScreen

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.

piersdeseilligny avatar Aug 02 '24 10:08 piersdeseilligny

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.

jfversluis avatar Aug 02 '24 11:08 jfversluis

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

piersdeseilligny avatar Aug 02 '24 16:08 piersdeseilligny

Merged for .NET 10

jfversluis avatar Feb 11 '25 15:02 jfversluis