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
3 answers

Black screen shown after launch screen

I have a storyboard file that I want to use as my launch screen. I have set the ViewController in that storyboard to be the initial one. I've also set the launch screen like so: Here's the code I have in my SceneDelegate for selecting the first…
narner
  • 2,908
  • 3
  • 26
  • 63
0
votes
0 answers

Objective C: function in sceneDidEnterBackground not running

I am testing out a NSTimer with selector in sceneDidEnterBackground, but the selector does not run when I press the home button once. I am trying to run a timer when the home button is pressed once. Does anyone know what is wrong? This is my code in…
Beck
  • 5
  • 3
0
votes
1 answer

Correct way of removing SceneDelegate from iOS 11+ project - What code is necessary in application(_: didFinishLaunchingWithOptions)

When creating a new iOS project in Xcode 12 a UISceneDelegate is added automatically. Since my App should be available on iOS 11+ (which does not support UISceneDelegate) I had to remove it. Removing the UISceneDelegate from info.plist and from the…
Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
0
votes
1 answer

[Carplay]: Crash of the main app at viewcontroller presentation while having the carplay app opened at the same time

I just implemented our new Carplay feature @Qobuz but I'm having a weird crash that I can't find an answer at. Scenario: Having the carplay app opened and using the application on the phone at the same time, if I ever open a viewcontroller that is…
tYp
  • 121
  • 9
0
votes
1 answer

LaunchOptions.locationKey in UIApplication didFinishLaunchingWithOptions nil

I'm monitoring significant location updates via CLLocationManager. When the app is killed and there is a location event, both App Delegate and Scene Delegate are being launched in the background appropriately. But…
iqra
  • 1,061
  • 1
  • 11
  • 18
0
votes
1 answer

Environment Object Method error in Scene Delegate

SO Community I have been self-teaching myself SwiftUI and I've just come across a problem while creating an application in the Scene Delegate. When I add an environment object method to the scene delegate to assign an object to the environment of a…
user14453246
0
votes
1 answer

How to dismiss view controller after login Swift

I am trying to dismiss a view controller after the user has logged in successfully, but so far it is crashing in the Home view controller when I set tableView.delegate = self in viewDidLoad(). This is the code I use after a successful…
ShedSports
  • 541
  • 2
  • 7
  • 14
0
votes
2 answers

Dismissing LoginVC after successful login

In my app the user is directed to a sign up/ log in viewController if they are not signed in. This logic happens in SceneDelegate, I am stuck on trying to present the initial view controller after the user either signs up or logs in. I've tried…
Noah Iarrobino
  • 1,435
  • 1
  • 10
  • 31
0
votes
1 answer

is this firestore closure causing a memory leak?

So my goal is to fix this condition issue when it comes to instantiating the right viewController. I have a function that I basically use to navigate a user to the right viewController depending on the type of user and if they're logged in or…
0
votes
1 answer

instantiate view controller from fcm push notification

So for some reason, there is always an issue when instantiating from AppDelegate. I have a notification with a UNNotificationAction and I handle the action selection in the didReceiveResponse() method. Here is the function: func…
0
votes
1 answer

how to get full viewController back when instantiating from SceneDelegate

So in my last question, I was trying to instantiate from the AppDelegate, but it wasn't working, so after doing more research I kept seeing SceneDelegate and decided to give it a try. To my surprise it worked, but not really how I wanted it to. So…
0
votes
1 answer

How do I correct this issue with reading an Environment Object? (SwiftUI and working without a SceneDelegate)

I wanted to write a template for apps that logs into firebase so that I can use it in future projects. I followed a tutorial online found on YouTube : https://www.youtube.com/watch?v=DotGrYBfCuQ&list=PLBn01m5Vbs4B79bOmI3FL_MFxjXVuDrma&index=2 So the…
0
votes
1 answer

How should I determine which scene is going to be opened by UIKit so I can setup my UI in the proper window? (iOS 13+)

Background I have an app that supports multiple windows (iPadOS 13+) and I want to know the proper way to respond to a user tapping on a notification. I want to set up the UI based on the notification that was tapped by the user. I am setting the…
Travis C.
  • 121
  • 1
  • 5
0
votes
0 answers

Why is viewController.navigationController returning nil when called from performActionFor in SceneDelegate?

I'm trying to create a quick action that will navigate to the 2nd view controller in my tab bar (vc1), then call a function which pushes another view controller (vc2) onto this one. Vc1 has a function called handleShowPopUp which contains the…
fisch
  • 136
  • 7
0
votes
1 answer

How can I include this swift declaration only before iOS 13.0

I have the following declaration in my AppDelegate.swift file. var window: UIWindow? and I want to include it only when the deployment target is set to below iOS 13.0. I have looked at @available(...) attribute but I don't think it can do what I…
Stephen501
  • 153
  • 8