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
0
votes
1 answer

Change navigation root view programmatically objective c

I want to change the navigation's root view controller programmatically using objective c. I am using a storyboard. I tried to change it in-app delegate but didn't work, there's something new introduced called scene delegate where I believe I can…
VeeN
  • 11
  • 1
0
votes
2 answers

In swift, how to save a variable with dependency injection, when the app enter background?

I have a variable from the class Person. i create this variable in the AppDelegate and inject it everywhere in the app. I convert it to JSON, in order to save it; and i retrieve it when the app is launched. But i need to save it too when the app go…
Wahib
  • 93
  • 1
  • 8
0
votes
1 answer

Message from debugger: Terminated due to signal 9 - is there a way to run a background operation?

I have noticed that when my app is running in the foreground, and then i explicitly terminate the my app by swiping up, then sceneDidDisconnect() is called. This is great, the enables me to do some tidying up. However, when the app is no longer in…
johnDoe
  • 709
  • 11
  • 29
0
votes
0 answers

Variables not loaded when pushing a modal from SceneDelegate

I'm trying to push a modal from the SceneDelegate. It all works well until the modal push runs. I'm gettin the error below, and Xcode says that the variables imagePreview and DownloadURL are nil. Yes the variables are loaded from firebase, as if I…
0
votes
0 answers

accessing viewController property from SceneDelegate - Swift - Programmatically

I have a blurEffect in a camera ViewController that I use to blur the cameraView whenever I pass from a viewController to another. I do that, animating the alpha value of it. These are the blur effect variables: var blur = UIBlurEffect(style:…
0
votes
1 answer

Swift Scene Delegate doesn't run code on first launch

I have a code which runs in Scene Delegate when opening the app using an UTI import File. Code works fine but the app has to be running and view controllers loaded for it to be executed, what can I do so the code is also ran when the app starts by…
user13891746
0
votes
2 answers

Xcode 11.5 IOS 13.5 Dark screen after setting view controller in Scenedelgate

Beginner Alert: I am doing Swift 11.6 with IOS 13.6. I am a beginner in Swift and I'm trying to check if my user has previously logged in or not. For this, I have used User Defaults, which seems to be working fine. The problem is when I initialize…
Gryffin
  • 99
  • 1
  • 8
0
votes
1 answer

How to stay on the launch screen until auto-login in Scene Delegate is complete?

I am trying to switch screens after auto-login in my scene delegate and everything works except my launch screen appears for like 10ms and then it goes to my ViewController(inital view controller) and then it switches screens to the screen I want it…
Kunal M
  • 47
  • 1
  • 5
0
votes
1 answer

Modify launch view when app is running in the background SwiftUI?

I understand that, in SwiftUI, the initial launch view is dependent on the Scene Delegate. So, with something like this: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { …
Evan
  • 1,892
  • 2
  • 19
  • 40
0
votes
0 answers

Configuring a UIViewController outside scene(_:willConnectTo:options:) then setting it to window rootViewController doesn't work

My intention is to initialize a view controller and set it to the window rootViewController, then pass the view controller as dependency to an AppCoordinator where the app decide what to do with the view controller (replace it with an onboarding…
Malloc
  • 15,434
  • 34
  • 105
  • 192
0
votes
1 answer

Functions of AppDelegate not being called

I have a problem with one of my apps. I noticed, that my Controller is still updating while the app is in the background. The reason for this is that the methods of the AppDelegate are not being called and I can not find out why. Here is my…
inexcitus
  • 2,471
  • 2
  • 26
  • 41
0
votes
1 answer

How can I call a function from scene delegate which downloads an URL in a view controller?

I am downloading an image in my view controller. I want to update my image every time the app enters the foreground. I tried to call the function to download the image from the scene delegate, but unfortunately, I get the error "Thread 1: Fatal…
JPJerry5
  • 107
  • 10
0
votes
1 answer

How to include a side menu into one of many view controllers? Xcode

I was following a tutorial for making a side menu which I want to implement into my home menu screen. The thing is I am having trouble presenting the side menu controller within only the home menu and not from the root view controller which is the…
0
votes
1 answer

How do I open a view controller from the app delegate?

I want to open the "Menu View Controller", when a local notification is opened from the Notification Center. My problem is that I do not know how I can open a view controller from the AppDelegate. All solutions I found did not work, because it were…
JPJerry5
  • 107
  • 10
0
votes
1 answer

Open specific UITabBarController / ViewController from SceneDelegate.swift

I have a Today Extension which has a UITableView. When the user taps one of the items in the UITableView, it opens the containing app with a URL Scheme and passes some data so that the containing app can open a specific view for the item the user…