Questions tagged [uiscenedelegate]

Methods you use to respond to life-cycle events occurring within a scene.

UISceneDelegate is available in UIKit since iOS 13.

From https://developer.apple.com/documentation/uikit/uiscenedelegate?language=objc

Use your UISceneDelegate object to manage life-cycle events in one instance of your app's user interface. This interface defines methods for responding to state transitions that affect the scene, including when the scene enters the foreground and becomes active, and when it enters the background. Use your delegate to provide appropriate behavior when these transitions occur. For example, finish critical tasks and quiet your app when it enters the background.

Do not create UISceneDelegate objects directly. Instead, specify the name of your custom delegate class as part of the configuration data for your scenes. You can specify this information in your app's Info.plist file, or in the UISceneConfiguration object you return from your app delegate's application:configurationForConnectingSceneSession:options: method.

156 questions
2
votes
1 answer

Getting "Error Domain=NSCocoaErrorDomain Code=257" in a document based app while attempting state restoration

Full error message is: [main] *** Error from FPBookmarkableStringFromDocumentURL, file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/MY_APP/hello.txt -> Error Domain=NSCocoaErrorDomain Code=257 "The file couldn’t be opened…
Jan Kriz
  • 21
  • 1
  • 2
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
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
  • 405
  • 4
  • 17
1
vote
0 answers

Carplay scenedelegate never called in SwiftUI

I am facing one issue where I have created a car play scene delegate file but it never gets executed. Here is my code for the app @main struct FredScannerProApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate var…
Jitendra Modi
  • 2,344
  • 12
  • 34
1
vote
0 answers

How to create unit test for UISceneConnectionOptions?

Is there a way to set the launch URL and source application property of connectionOptions/UISceneConnectionOptions for testing SceneDelegate? I see that the properties of UISceneConnectionOptions are all read-only but I was wondering if there are…
Z X
  • 11
  • 2
1
vote
0 answers

Detect tap on green tag in call kit

We are using call kit to receive calls for our app. When call is received on call kit green tag appears on left top as shown in the image attached. When user taps on green tag application is resumed from background. We are unable to detect the app…
abh
  • 1,189
  • 2
  • 14
  • 30
1
vote
0 answers

Interfaces of Swift extension not called if put in separate target

I have a SceneDelegate class which is part of Target 1 code. Target 1 is compiled as a static library. public class SceneDelegate: UIResponder, UIWindowSceneDelegate { public var window: UIWindow? // SceneDidBecomeActive // other…
Abhi_M
  • 298
  • 1
  • 5
1
vote
1 answer

UIWindow in SceneDelegate

Recently, I encountered a problem, which I have posted here, in stackoverflow. Apparently, the error was because a random UIWindow variable was used to display UI (and not the one in SceneDelegate). Here's my understanding - Every time a scene is…
NightFuryLxD
  • 847
  • 5
  • 15
1
vote
0 answers

SignificantLocationChanges with SceneDelegate

I am working with significantLocationChanges and in killed state when there is a significant location change then it wakes up the app but launchOptions is always nil I heard that if you are using SceneDelegate then launchOptions in AppDelegate will…
1
vote
0 answers

How to show animation when open new Window in SwiftUI

I have Bottom sheet I want to show it above TabBar so user tab on button inside List and it show options as Bottom sheet view 1st. I used SwiftUIX with OverlayWindow like this .windowOverlay(isKeyAndVisible: self.$optionsShown, { …
Basel
  • 550
  • 8
  • 21
1
vote
2 answers

Swift : self.window?.rootViewController doesn't work in AppDelegate

I want to navigate to a certain screen when the user press on the push notification. However, self.window?.rootViewController keeps on giving me error, which is Thread 1: Swift runtime failure: force unwrapped a nil value. Now I have tried using…
1
vote
1 answer

How to remove "safeArea" appearance on the small screens in Swift? (Background is not on a full screen)

I'm making a project and fighting with the problem with the black borders - I can't understand why my background is not on a full screen. It seems like the anchors are right, maybe the problem is in SceneDelegate, but I don't know exactly. Here is…
1
vote
1 answer

Call Flutter Methods or functions from the native code base

I want to make a few flutter function calls for leaving or closing the resources acquired by the flutter app in an event of app crash or moving into the background. These life cycle methods are available in the SceneDelegate.swift and…
Akash g krishnan
  • 469
  • 5
  • 16
1
vote
1 answer

Navigate through Scene Delegate

I'm trying to get the blue screen view of my storyboard, but I'm entirely new to this. I don't understand how to navigate through the classes to get to "the blue screen," and it gives me errors. Story Board Image The original idea is to propagate…
Omairys
  • 69
  • 1
  • 6
1
vote
1 answer

RootViewController transition effect does not work

let storyboard = UIStoryboard(name: "Main", bundle: nil) let protectionVC = storyboard.instantiateViewController(identifier: "PrivacyProtectionViewController") guard let windowScene = self.window?.windowScene else { return …
LovNina
  • 13
  • 2