uiscenedelegate

UIApplication.shared.delegate equivalent for SceneDelegate xcode11?

江枫思渺然 提交于 2019-12-17 12:16:40
问题 I have defined a let property within my SceneDelegate. I would like some of the ViewControllers to be able to access that within the scene. In UIKit I could access App Delegate properties like this: UIApplication.shared.delegate then casting and specifying the property name... Is there an equivalent to get the a reference to the SceneDelegate the view controller is in from the UIViewController's instance? 回答1: As of iOS 13, UIApplication has the connectedScenes property which is Set<UIScene>

`scene(_ scene: UIScene, continue userActivity: NSUserActivity)` doesn't get called when the app is launched after the user clicks on a universal link

风格不统一 提交于 2019-12-06 21:50:34
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 link. The sample code: func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { guard userActivity.activityType == NSUserActivityTypeBrowsingWeb, let incomingURL = userActivity.webpageURL, let components = NSURLComponents(url: incomingURL, resolvingAgainstBaseURL: true), let path = components.path else { return } let params = components

How get rootViewController with iPadOS multi window (SceneDelegate)?

牧云@^-^@ 提交于 2019-12-04 11:13:02
问题 I am using Xcode 11 (beta3) and building an app for iOS 13. In my project I created the delegate methods for UIWindowSceneDelegate declaring it in Info.plist. Now I'm able to create multiple windows (and UIScene). How can I access the rootViewController now I've not anymore a single window? I need it to get some reference to objects and bounds it holds. In my AppDelegate window is nil , and in my ViewController (child view controller) instance I tried using self.view.window.rootViewController

How get rootViewController with iPadOS multi window (SceneDelegate)?

谁说我不能喝 提交于 2019-12-03 16:01:35
I am using Xcode 11 (beta3) and building an app for iOS 13. In my project I created the delegate methods for UIWindowSceneDelegate declaring it in Info.plist. Now I'm able to create multiple windows (and UIScene). How can I access the rootViewController now I've not anymore a single window? I need it to get some reference to objects and bounds it holds. In my AppDelegate window is nil , and in my ViewController (child view controller) instance I tried using self.view.window.rootViewController but I found out that viewDidLoad() is too soon (I think) and the window is still nil, works in

UIWindow not showing over content in iOS 13

*爱你&永不变心* 提交于 2019-12-03 05:08:41
问题 I am upgrading my app to use the new UIScene patterns as defined in iOS 13, however a critical part of the app has stopped working. I have been using a UIWindow to cover the current content on the screen and present new information to the user, but in the current beta I am working with (iOS + XCode beta 3) the window will appear, but then disappear straight away. Here is the code I was using, that now does not work: let window = UIWindow(frame: UIScreen.main.bounds) let viewController =

UIWindow not showing over content in iOS 13

自闭症网瘾萝莉.ら 提交于 2019-12-02 19:36:51
I am upgrading my app to use the new UIScene patterns as defined in iOS 13, however a critical part of the app has stopped working. I have been using a UIWindow to cover the current content on the screen and present new information to the user, but in the current beta I am working with (iOS + XCode beta 3) the window will appear, but then disappear straight away. Here is the code I was using, that now does not work: let window = UIWindow(frame: UIScreen.main.bounds) let viewController = UIViewController() viewController.view.backgroundColor = .clear window.rootViewController = viewController

App delegate methods aren't being called in iOS 13

二次信任 提交于 2019-11-28 21:25:54
问题 I am using Xcode 11 and building an app for iOS 13. In a new project I created in Xcode some of the UIApplicationDelegate methods were missing so I added them back into the app delegate file. The new template for a "Single View App" project was missing the methods. The problem is that none of the delegate methods are getting called except -application:didFinishLaunchingWithOptions: . Here is my app delegate: @implementation AppDelegate - (BOOL)application:(UIApplication *)application