Questions tagged [uiscene]

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

31 questions
339
votes
30 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
  • 4,344
  • 3
  • 17
  • 27
27
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
  • 314,917
  • 42
  • 532
  • 579
19
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,938
  • 7
  • 45
  • 93
16
votes
4 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
  • 527
  • 5
  • 13
12
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,824
  • 18
  • 31
10
votes
7 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
  • 1,141
  • 14
  • 32
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:…
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…
Diz
  • 71
  • 6
4
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
  • 405
  • 4
  • 17
2
votes
1 answer

What is the difference between a scene and a window in iOS app development?

According to Apple's official documentation: A scene is represented by a UIScene object. Apple defines this as: "An object that represents one instance of your app’s user interface" source: https://developer.apple.com/documentation/uikit/uiscene A…
ennell
  • 35
  • 1
  • 8
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
  • 91
  • 3
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
  • 8,534
  • 5
  • 60
  • 108
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
  • 373
  • 3
  • 19
2
votes
2 answers

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…
Nike Kov
  • 12,630
  • 8
  • 75
  • 122
2
votes
1 answer

iOS 13 performActionFor shortcutItem doesn't get called in SceneDelegate now on launch, but does after app launches. Why?

performActionFor shortcutItem gets called in my SceneDelegate if the app has already launched, but it doesn't get called if the app actually launches from a shortcut item. Why is this?
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
1
2 3