2

I'm using UIScenes and SwiftUI to create a simple app.

I need to create multiple windows programmatically, but not with the same design outcome from requestSceneSessionActivation, that splits the screen into 2 pieces. I need the other one, like the image... enter image description here

I didn't find anything in the UIScene documentation for it. If you know a way to close it too, it would be awesome!

Carla Camargo
  • 574
  • 5
  • 14

1 Answers1

5

Unfortunately UISceneActivationRequestOptions (passed to requestSceneSessionActivation) doesn't provide an option to specify how the new scene should be presented. Oddly there is a UIWindowSceneDestructionRequestOptions class for indicating how a scene can be dismissed. There should be a UIWindowSceneActivationRequestOptions class that allows you specify how it is shown. I suggest filing an enhancement request with Apple using the Feedback app on iOS 13.

Closing a scene can be done using UIApplication requestSceneSessionDestruction.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • Thank you @rmaddy! I opened the feedback request... Let's see if I get any answer any time soon. – Carla Camargo Sep 16 '19 at 12:45
  • 1
    @CarlaCamargo Don't expect an answer ever. They will either add it in some future version of iOS or they won't. But you will never get a reply. – rmaddy Sep 16 '19 at 15:38
  • iOS 15 introduced UIWindowScene.ActivationRequestOptions with the option .prominent -- still not quite what you want. – Clafou Nov 04 '22 at 18:39