Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Samples/SessionReplay-CameraTest/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
Comment thread
denrase marked this conversation as resolved.
Outdated

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
SentrySDKWrapper.shared.startSentry()
SampleAppDebugMenu.shared.display()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
// Mirror the scene window to AppDelegate.window for shared sample helpers.
var window: UIWindow? {
didSet {
(UIApplication.shared.delegate as? AppDelegate)?.window = window
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?
// Mirror the scene window to AppDelegate.window for shared sample helpers.
var window: UIWindow? {
didSet {
(UIApplication.shared.delegate as? AppDelegate)?.window = window
}
}

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
Expand Down
19 changes: 19 additions & 0 deletions Samples/iOS-ObjectiveC-Dynamic/App/Configurations/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
10 changes: 10 additions & 0 deletions Samples/iOS-ObjectiveC-Dynamic/App/Sources/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,14 @@ - (BOOL)application:(UIApplication *)application
return YES;
}

#pragma mark - UISceneSession lifecycle

- (UISceneConfiguration *)application:(UIApplication *)application
configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession
options:(UISceneConnectionOptions *)options
{
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration"
sessionRole:connectingSceneSession.role];
}

@end
7 changes: 7 additions & 0 deletions Samples/iOS-ObjectiveC-Dynamic/App/Sources/SceneDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <UIKit/UIKit.h>

@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>

@property (nonatomic, strong) UIWindow *window;

@end
18 changes: 18 additions & 0 deletions Samples/iOS-ObjectiveC-Dynamic/App/Sources/SceneDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#import "SceneDelegate.h"
#import "AppDelegate.h"

@implementation SceneDelegate

- (void)scene:(UIScene *)scene
willConnectToSession:(UISceneSession *)session
options:(UISceneConnectionOptions *)connectionOptions
{
if (![scene isKindOfClass:UIWindowScene.class]) {
return;
}

AppDelegate *appDelegate = (AppDelegate *)UIApplication.sharedApplication.delegate;
appDelegate.window = self.window;
}

@end
19 changes: 19 additions & 0 deletions Samples/iOS-ObjectiveC-Static/App/Configurations/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
10 changes: 10 additions & 0 deletions Samples/iOS-ObjectiveC-Static/App/Sources/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,14 @@ - (BOOL)application:(UIApplication *)application
return YES;
}

#pragma mark - UISceneSession lifecycle

- (UISceneConfiguration *)application:(UIApplication *)application
configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession
options:(UISceneConnectionOptions *)options
{
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration"
sessionRole:connectingSceneSession.role];
}

@end
7 changes: 7 additions & 0 deletions Samples/iOS-ObjectiveC-Static/App/Sources/SceneDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <UIKit/UIKit.h>

@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>

@property (nonatomic, strong) UIWindow *window;

@end
18 changes: 18 additions & 0 deletions Samples/iOS-ObjectiveC-Static/App/Sources/SceneDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#import "SceneDelegate.h"
#import "AppDelegate.h"

@implementation SceneDelegate

- (void)scene:(UIScene *)scene
willConnectToSession:(UISceneSession *)session
options:(UISceneConnectionOptions *)connectionOptions
{
if (![scene isKindOfClass:UIWindowScene.class]) {
return;
}

AppDelegate *appDelegate = (AppDelegate *)UIApplication.sharedApplication.delegate;
appDelegate.window = self.window;
}

@end
19 changes: 19 additions & 0 deletions Samples/iOS-ObjectiveC/App/Configurations/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@
<string>&lt;status&gt;</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
8 changes: 8 additions & 0 deletions Samples/iOS-ObjectiveC/App/Sources/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,12 @@ - (BOOL)application:(UIApplication *)application

#pragma mark - UISceneSession lifecycle

- (UISceneConfiguration *)application:(UIApplication *)application
configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession
options:(UISceneConnectionOptions *)options
{
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration"
sessionRole:connectingSceneSession.role];
}

@end
7 changes: 7 additions & 0 deletions Samples/iOS-ObjectiveC/App/Sources/SceneDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <UIKit/UIKit.h>

@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>

@property (nonatomic, strong) UIWindow *window;

@end
18 changes: 18 additions & 0 deletions Samples/iOS-ObjectiveC/App/Sources/SceneDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#import "SceneDelegate.h"
#import "AppDelegate.h"

@implementation SceneDelegate

- (void)scene:(UIScene *)scene
willConnectToSession:(UISceneSession *)session
options:(UISceneConnectionOptions *)connectionOptions
{
if (![scene isKindOfClass:UIWindowScene.class]) {
return;
}

AppDelegate *appDelegate = (AppDelegate *)UIApplication.sharedApplication.delegate;
appDelegate.window = self.window;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
10 changes: 10 additions & 0 deletions Samples/iOS-ObjectiveCpp-NoModules/App/Sources/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,14 @@ - (BOOL)application:(UIApplication *)application
return YES;
}

#pragma mark - UISceneSession lifecycle

- (UISceneConfiguration *)application:(UIApplication *)application
configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession
options:(UISceneConnectionOptions *)options
{
return [[UISceneConfiguration alloc] initWithName:@"Default Configuration"
sessionRole:connectingSceneSession.role];
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#import <UIKit/UIKit.h>

@interface SceneDelegate : UIResponder <UIWindowSceneDelegate>

@property (nonatomic, strong) UIWindow *window;

@end
18 changes: 18 additions & 0 deletions Samples/iOS-ObjectiveCpp-NoModules/App/Sources/SceneDelegate.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#import "SceneDelegate.h"
#import "AppDelegate.h"

@implementation SceneDelegate

- (void)scene:(UIScene *)scene
willConnectToSession:(UISceneSession *)session
options:(UISceneConnectionOptions *)connectionOptions
{
if (![scene isKindOfClass:UIWindowScene.class]) {
return;
}

AppDelegate *appDelegate = (AppDelegate *)UIApplication.sharedApplication.delegate;
appDelegate.window = self.window;
}

@end
19 changes: 19 additions & 0 deletions Samples/iOS-Swift/App/Configurations/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@
<string>Testing app intents</string>
<key>NSSupportsSiriKit</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
Expand Down
8 changes: 7 additions & 1 deletion Samples/iOS-Swift/App/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
private var randomDistributionTimer: Timer?
var window: UIWindow?
Comment thread
cursor[bot] marked this conversation as resolved.

var args: [String] {
ProcessInfo.processInfo.arguments
}
Expand Down Expand Up @@ -41,6 +41,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func applicationWillTerminate(_ application: UIApplication) {
metricKit.pauseReports()
Expand Down
2 changes: 1 addition & 1 deletion Samples/iOS-Swift/App/Sources/ExtraViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class ExtraViewController: UIViewController {
}

@IBAction func showTopVCInspector(_ sender: UIButton) {
TopViewControllerInspector.show()
TopViewControllerInspector.show(in: view.window)
}

@IBAction func close(_ sender: UIButton) {
Expand Down
10 changes: 10 additions & 0 deletions Samples/iOS-Swift/App/Sources/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// Mirror the scene window to AppDelegate.window for shared sample helpers.
var window: UIWindow? {
didSet {
(UIApplication.shared.delegate as? AppDelegate)?.window = window
Comment thread
denrase marked this conversation as resolved.
Outdated
}
}
}
Loading
Loading