How to prevent closing a MobileScreen shown as sheet when the user clicks on the background window?

Hi,

In my app, I show several windows modally, as a sheet; the result is then transmitted using delegates to the calling window when the user clicks a button (and the sheet is also closed).

Now, if the user clicks on the parent window, the sheet is closed by the OS/framework and the changes are just lost. How may I prevent the sheet from being closed in this case?

Hi Arnaud,

Using iOSDesignExtensions, you can set a screen to be “full” modal:

theScreen.SetFullModalXC(True)

Or if you don’t use iOSDesignExtensions:

Declare sub setModalInPresentation lib "UIKit.framework" Selector "setModalInPresentation:" (obj_id as ptr, value as Boolean)
		    setModalInPresentation(screen.ViewControllerHandle, true)
3 Likes

Hi Jeremie,

Excellent; that’s the solution!
I’m sure iOSDesignExtension contains a lot of other useful stuffs; I should’ve tried it earlier.

Thank you.