Questions tagged [uiscene]

For questions about the scene/window management APIs introduced in UIKit in iOS 13.

26 questions
186
votes
17 answers

How to resolve: 'keyWindow' was deprecated in iOS 13.0

I'm using Core Data with Cloud Kit, and have therefore to check the iCloud user status during application startup. In case of problems I want to issue a dialog to the user, and I do it using…
Hardy
  • 2,424
  • 2
  • 12
  • 20
23
votes
4 answers

UI state restoration for a scene in iOS 13 while still supporting iOS 12. No storyboards

This is a little long but it's not trivial and it takes a lot to demonstrate this issue. I'm trying to figure out how to update a little sample app from iOS 12 to iOS 13. This sample app doesn't use any storyboards (other than the launch screen).…
rmaddy
  • 298,130
  • 40
  • 468
  • 517
14
votes
2 answers

UIScene concept is not clear

Before we all get used to the approach when in AppDelegate we create UIWindow and then set rootViewController for this Window. Sometimes when we needed to have a custom alert we can create a new UIWindow that will be above. Now Xcode automatically…
Paul T.
  • 4,226
  • 6
  • 39
  • 84
7
votes
4 answers

Getting currently focused UIScene when multiple connected scenes are active in foreground

I have a problem getting the current UIScene when multiple scenes are connected. Specifically, my app (iOS 13) supports multiple windows on the iPad. When I have two windows side by side and I access the apps connected scenes (with…
freshking
  • 1,686
  • 15
  • 26
7
votes
6 answers

How get current keywindow equivalent for multi window SceneDelegate Xcode 11?

I'm converting my iOS13 app for iPadOS to SceneDelegate (multi window). How can I get the current UIWindow from the current SceneDelegate? I know that a can access the current scene using UIView.window or UIViewController.view.window, but I have a…
Fabiosoft
  • 883
  • 12
  • 23
5
votes
0 answers

How do I decide which window to open Notification Settings in on iOS 13 for userNotificationCenter:openSettingsFor:?

iOS has the following method that gets called so you can offer custom notification settings to a user through Notification Center or the Settings app: func userNotificationCenter(_ center: UNUserNotificationCenter, openSettingsFor notification:…
5
votes
3 answers

`scene(_ scene: UIScene, continue userActivity: NSUserActivity)` doesn't get called when the app is launched after the user clicks on a universal link

Method scene(_ scene: UIScene, continue userActivity: NSUserActivity) doesn't get called when the app is launched after the user clicks on a universal link. It works fine when already launched app opens again after the user clicks on the universal…
Dmitry
  • 317
  • 2
  • 11
4
votes
1 answer

iOS 13 isKeyWindow always returns nil

I am wondering why: UIApplication.shared.windows.first { $0.isKeyWindow } always returns nil both in the simulator and on device. You can confirm this by putting a break point in viewDidLoad in any view controller and printing the object to the…
Adam Dahan
  • 51
  • 3
3
votes
4 answers

Using UIScenes in iOS 13, how do I AirPlay Mirror a screen (seems to default to external display)

If I compile onto an iOS 12 device (doesn't use UIScene) and AirPlay Mirror to my Apple TV the app is mirrored as expected to the TV. On an iOS 13 device, it seems to treat it as an external display where it's formatted to fit the screen (but I have…
christianselig
  • 306
  • 4
  • 14
2
votes
1 answer

Modal dialogs breaking responder chain in mac catalyst scene based app

I have a multi-window scene-based (not SwiftUI) iPad app that I am adapting for Mac using mac catalyst. I am having trouble with the main menu behavior. The menu is built in AppDelegate.swift using func buildMenu(). I have, for example, an Open…
David Mann
  • 31
  • 2
2
votes
0 answers

AppDelegate not used when scenes configured in Info.plist

I have an old (Objective-C) iOS app that I expanded to Mac Catalyst, and now I want to add multi-window support to the Mac version, without affecting the iOS version. In accordance with several tutorials (example), I've set up a SceneDelegate like…
arlomedia
  • 7,625
  • 5
  • 53
  • 96
2
votes
1 answer

Context Menu blocks Drag and Drop into new window

This iPadOS/iOS 13 app implements both multiple windows and drag and drop. In almost every case, both work perfectly. We encounter our only problem in a table view that implements the context menu methods of UITableViewDelegate. -…
AVS
  • 253
  • 1
  • 11
2
votes
1 answer

iOS 13 UIWindowScene how to lock orientation?

I want to use SceneDelegate, UIWindowScene, UIWindowSceneDelegate and other UIScene related things. func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let…
Nik Kov
  • 10,605
  • 4
  • 56
  • 96
2
votes
0 answers

How do you get a reference to your Scene Delegate (UIWindowSceneDelegate) as you would with your AppDelegate (UIApplicationDelegate)?

Prior to iOS 13, when AppDelegate was king, you could do (well you still can) UIApplication.shared.delegate to get a reference to your AppDelegate. But how do you get a reference to your UIWindowSceneDelegate that manages a single window scene in…
christianselig
  • 306
  • 4
  • 14
1
vote
1 answer

Status bar height in SwiftUI in iOS 13

How do you get the current scene's status bar height for use in a SwiftUI view? It looks like the key is accessing the current scene. From a view controller, you can use view.window?.windowScene to get to the scene, but what about in a SwiftUI view?
Edward Brey
  • 35,877
  • 14
  • 173
  • 224
1
2