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

Use of scene delegate for apps that does not support multiple windows

I know that scene delegate can only be used on iOS 13 and later. For my app to support iOS 12 and earlier versions, its either I opt-out of scene delegate or set @available tag to remind Xcode. I read about the use of scene delegate here. Based on…
Random Forkson
  • 71
  • 3
  • 17
3
votes
1 answer

How to use new Scene Delegate in Xcode

I'm trying to change a Label's text or show an alert when my iOS app becomes active from the background state. When I call a function in the ViewController class only the print() method works fine. But when I want to interact with the objects in…
anixrud
  • 184
  • 3
  • 11
3
votes
0 answers

Lower deployment target in Xcode11

How do I safely lower the deployment target when creating a new project in Xcode11? I create a single view app -> Language - Swift, User Interface - Storyboard. Xcode creates a SceneDelegate.swift along with a storyboard file which I thought was…
Danylo Kurylo
  • 235
  • 2
  • 11
2
votes
0 answers

SwiftUI perform UI change in background

I am currently implementing a secure window which blocks the View if the app is in the background or shown in the app switcher. However, if the scenePhase is set to background, the View doesn't change in the app switcher. If the View is changed when…
Nimbahus
  • 477
  • 3
  • 16
2
votes
0 answers

Set SceneDelegate in info.plist file

I have an app target and a few static libs. Due to some reasons, I moved the SceneDelegate from the app target to one of the static libs. In the info.plist file, the SceneDelegate is set as $(PRODUCT_MODULE_NAME).SceneDelegate (as shown…
NightFuryLxD
  • 847
  • 5
  • 15
2
votes
1 answer

LaunchOptions is always nil with SceneDelegate

I have investigated siginificant location. I would like to get location information when not running app. https://developer.apple.com/documentation/corelocation/getting_the_user_s_location/using_the_significant-change_location_service The following…
funzin
  • 21
  • 3
2
votes
3 answers

when need to switch the rootViewController

I've been working on a Swift project and I have two view controllers, the login view controller & the home view controller. When a user launches the app, I want to display the login view controller if the user is not logged in, on the other hand, if…
Yuuu
  • 715
  • 1
  • 9
  • 32
2
votes
1 answer

sceneDidEnterBackground is not called on iOS, swift

I am implementing the iOS app with coordinator pattern and I need to show some privacy screen when the app enters background. class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? var coordinator:…
Async-
  • 3,140
  • 4
  • 27
  • 49
2
votes
0 answers

Using showBluetoothAccessoryPicker causes SceneDelegate presenting errors

I currently have an app that will try to automatically discover a MFi bluetooth device. The only way is to use the ExternalAccessory framework, as CoreBluetooth only files Ble devices. Right now I have a button that…
Derek
  • 2,927
  • 3
  • 20
  • 33
2
votes
1 answer

Passing data from Scene Delegate to ViewController when opening app with URL

I need to Show a View on my initial controller and set a UILabel when the app launches through URL Dynamic Link during Firebase Email Verification. Problem I'm having is the label is not initialised so app crashes during the process. I have tried…
2
votes
1 answer

How to transfer a value from a SceneDelegate file to a ViewController (Swift 5)

In one of the SceneDelegate methods, I want to assign a value to a variable that is in another ViewController. How can i do this? Always getting nil. I tried different methods, but for some reason they do not work, I wanted to use the completion…
VyacheslavB
  • 181
  • 9
2
votes
1 answer

macOS Catalyst `requestSceneSessionActivation` requires multiwindow adoption

When trying to open a new window in a macOS Catalyst application, I'm using this enum to describe an instance of NSUserActivity: enum Activity: String { case list case settings var type: String { "com.example.app.\(rawValue)" } var…
Max Desiatov
  • 5,087
  • 3
  • 48
  • 56
2
votes
2 answers

How to make Onboarding work with Scene Delegate in iOS13?

I am trying to set up my onboarding screen in the SceneDelegate. When I run the code below, it compiles, but just goes to a black screen. They're many great onboarding tutorials for AppDelegate, but very few for the new SceneDelegate with iOS13. I…
2
votes
1 answer

SwiftUI: How to get window in Objective-C

let scene = UIApplication.shared.connectedScenes.first if let sd: SceneDelegate = (scene?.delegate as? SceneDelegate) { let window = sd.window } this is in Swift, I want to convert this into Objective-C. I have tried this: UIScene *scene =…
Mad Burea
  • 83
  • 8
2
votes
0 answers

SceneDelegate in iOS 13, Is it necessary?

I have an app that was initially written with minimum iOS target of iOS 11 After adding new features and support for iOS 13, the recent version now requires minimum iOS target of iOS 13. There is no SceneDelegate in my project at all and still the…
FE_Tech
  • 1,534
  • 13
  • 25
1 2
3
10 11