When trying to open a new window in a macOS Catalyst application, I'm using this enum to describe an instance of NSUserActivity
:
enum Activity: String {
case list
case settings
var type: String {
"com.example.app.\(rawValue)"
}
var userActivity: NSUserActivity {
NSUserActivity(activityType: type)
}
}
Then to open a new window, I use this code in a button tap handler, as described in this raywenderlich.com tutorial:
UIApplication
.shared
.requestSceneSessionActivation(
nil,
userActivity: Activity.settings.userActivity,
options: nil,
errorHandler: nil
)
However, this doesn't work and I always get this error message in the debugger console:
[Scene] Calling -[UIApplication requestSceneSessionActivation:] requires multiwindow adoption.
What does this error message mean and what are possibly missing steps here to make support for multiple windows work in a Catalyst app?