I'am trying to create a new window programmatically by dragging a cell which is similiar to dragging a mail cell in Mail app to show the mail content in new window. I tried to create the new window by calling the function requestSceneSessionActivation(_:userActivity:options:errorHandler:) in drag and drop delegate functions but it gives some different results I need to implement the same as in the Mail app.
How to create a new window by dragging a view or cell programmatically?
You have to create a NSUseractivity object when starting a drag session and register that object to NSItemProvider object.
And don’t forget to register the activitytype you pass in to the NSuseractivity object in Info.plist
And when you drag your view to the end of screen new window will be created
but you have to fetch the activity object from “willConnectToSession” method in scene delegate through connectionOptions object like this “connectionOptions.userActivities.first”.
It didn't worked in beta 2 but its working fine in beta 3