iosios13uiscene

How to check if the current iOS device supports multiple scenes/windows?


I'm adding an "Open in New Window" context menu item which opens one of my app's documents in a new UIScene. Of course, I only want to show that menu item on devices which actually support multiple scenes.

Currently I'm just checking if the device is an iPad using good old:

if UIDevice.current.userInterfaceIdiom == .pad

Is there a more precise way of checking whether the device supports this specific capability?


Solution

  • Check UIApplication property supportsMultipleScenes.

    Use the connectedScenes property to determine whether multiple scenes are present.

    More info from official documentation here