diff --git a/Examples/Maps/Maps.xcodeproj/project.pbxproj b/Examples/Maps/Maps.xcodeproj/project.pbxproj index 2a250694b..054c2ed08 100644 --- a/Examples/Maps/Maps.xcodeproj/project.pbxproj +++ b/Examples/Maps/Maps.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 4B8B697B305E0FEC0083E3B6 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B697A305E0FEC0083E3B6 /* SceneDelegate.swift */; }; 543844BD23D2BE2000D5EDE4 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 543844BC23D2BE2000D5EDE4 /* MapKit.framework */; }; 549A5F59244673FE0025F312 /* SearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 549A5F58244673FE0025F312 /* SearchViewController.swift */; }; 549D23D2233C77D5008EF4D7 /* FloatingPanel.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 549D23D1233C77D5008EF4D7 /* FloatingPanel.framework */; }; @@ -36,6 +37,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 4B8B697A305E0FEC0083E3B6 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 543844BC23D2BE2000D5EDE4 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; 549A5F58244673FE0025F312 /* SearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchViewController.swift; sourceTree = ""; }; 549D23D1233C77D5008EF4D7 /* FloatingPanel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = FloatingPanel.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -102,6 +104,7 @@ 54B5112B216C3D840033A6F3 /* MainViewController.swift */, 549A5F58244673FE0025F312 /* SearchViewController.swift */, 54E26CB724A98E310066C720 /* DetailViewController.swift */, + 4B8B697A305E0FEC0083E3B6 /* SceneDelegate.swift */, 54E26CB524A989090066C720 /* Utils.swift */, 54B51135216C3D860033A6F3 /* Info.plist */, ); @@ -185,6 +188,7 @@ 54E26CB824A98E310066C720 /* DetailViewController.swift in Sources */, 54B5112A216C3D840033A6F3 /* AppDelegate.swift in Sources */, 54E26CB624A989090066C720 /* Utils.swift in Sources */, + 4B8B697B305E0FEC0083E3B6 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Examples/Maps/Maps/AppDelegate.swift b/Examples/Maps/Maps/AppDelegate.swift index 57b82957b..9b555938a 100644 --- a/Examples/Maps/Maps/AppDelegate.swift +++ b/Examples/Maps/Maps/AppDelegate.swift @@ -2,8 +2,24 @@ import UIKit -@UIApplicationMain +@main class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? -} + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + true + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } +} diff --git a/Examples/Maps/Maps/Info.plist b/Examples/Maps/Maps/Info.plist index 16be3b681..080e1ab27 100644 --- a/Examples/Maps/Maps/Info.plist +++ b/Examples/Maps/Maps/Info.plist @@ -41,5 +41,24 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + diff --git a/Examples/Maps/Maps/SceneDelegate.swift b/Examples/Maps/Maps/SceneDelegate.swift new file mode 100644 index 000000000..577eedf72 --- /dev/null +++ b/Examples/Maps/Maps/SceneDelegate.swift @@ -0,0 +1,42 @@ +// Copyright 2026 the FloatingPanel authors. All rights reserved. MIT license. + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + var window: UIWindow? + + 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`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } +} diff --git a/Examples/Samples/Samples.xcodeproj/project.pbxproj b/Examples/Samples/Samples.xcodeproj/project.pbxproj index af5b924a0..fabc258e8 100644 --- a/Examples/Samples/Samples.xcodeproj/project.pbxproj +++ b/Examples/Samples/Samples.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 4B8B6982305E10660083E3B6 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B6981305E10660083E3B6 /* SceneDelegate.swift */; }; 5442E22425FC51AF00A26F43 /* ImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5442E22325FC51AF00A26F43 /* ImageViewController.swift */; }; 5442E22825FC51E200A26F43 /* MultiPanelController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5442E22725FC51E200A26F43 /* MultiPanelController.swift */; }; 5442E22C25FC521F00A26F43 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5442E22B25FC521F00A26F43 /* SettingsViewController.swift */; }; @@ -52,6 +53,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 4B8B6981305E10660083E3B6 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 5442E22325FC51AF00A26F43 /* ImageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageViewController.swift; sourceTree = ""; }; 5442E22725FC51E200A26F43 /* MultiPanelController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiPanelController.swift; sourceTree = ""; }; 5442E22B25FC521F00A26F43 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = ""; }; @@ -144,6 +146,7 @@ 5442E22225FC519700A26F43 /* ContentViewControllers */, 54EAD35A263A75EB006A36EA /* PanelLayouts.swift */, 546341AB25C6426500CA0596 /* CustomState.swift */, + 4B8B6981305E10660083E3B6 /* SceneDelegate.swift */, 54CDC5D7215BBE23007D205C /* SupplementaryViews.swift */, 54B51115216AFE5F0033A6F3 /* Extensions.swift */, 545DB9F921511E6400CA77B8 /* Info.plist */, @@ -257,6 +260,7 @@ 54CDC5D8215BBE23007D205C /* SupplementaryViews.swift in Sources */, 54B51116216AFE5F0033A6F3 /* Extensions.swift in Sources */, 544BC56826CC918200D0A436 /* TableViewControllerForAdaptiveLayout.swift in Sources */, + 4B8B6982305E10660083E3B6 /* SceneDelegate.swift in Sources */, 5442E24A25FC53C100A26F43 /* DebugTextViewController.swift in Sources */, 546341AC25C6426500CA0596 /* CustomState.swift in Sources */, 5442E23A25FC52CD00A26F43 /* ModalViewController.swift in Sources */, diff --git a/Examples/Samples/Sources/AppDelegate.swift b/Examples/Samples/Sources/AppDelegate.swift index 1e97cff9d..9b555938a 100644 --- a/Examples/Samples/Sources/AppDelegate.swift +++ b/Examples/Samples/Sources/AppDelegate.swift @@ -2,7 +2,24 @@ import UIKit -@UIApplicationMain +@main class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } } diff --git a/Examples/Samples/Sources/Info.plist b/Examples/Samples/Sources/Info.plist index 16be3b681..080e1ab27 100644 --- a/Examples/Samples/Sources/Info.plist +++ b/Examples/Samples/Sources/Info.plist @@ -41,5 +41,24 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + diff --git a/Examples/Samples/Sources/SceneDelegate.swift b/Examples/Samples/Sources/SceneDelegate.swift new file mode 100644 index 000000000..577eedf72 --- /dev/null +++ b/Examples/Samples/Sources/SceneDelegate.swift @@ -0,0 +1,42 @@ +// Copyright 2026 the FloatingPanel authors. All rights reserved. MIT license. + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + var window: UIWindow? + + 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`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } +} diff --git a/Examples/SamplesObjC/SamplesObjC.xcodeproj/project.pbxproj b/Examples/SamplesObjC/SamplesObjC.xcodeproj/project.pbxproj index cb13dbdef..2d8862f8d 100644 --- a/Examples/SamplesObjC/SamplesObjC.xcodeproj/project.pbxproj +++ b/Examples/SamplesObjC/SamplesObjC.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 4B8B69AE305E11340083E3B6 /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B69AD305E11340083E3B6 /* SceneDelegate.m */; }; 545BA70621BA3214007F7846 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 545BA70521BA3214007F7846 /* AppDelegate.m */; }; 545BA70921BA3214007F7846 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 545BA70821BA3214007F7846 /* MainViewController.m */; }; 545BA70C21BA3214007F7846 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 545BA70A21BA3214007F7846 /* Main.storyboard */; }; @@ -32,6 +33,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 4B8B69AC305E11340083E3B6 /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = ""; }; + 4B8B69AD305E11340083E3B6 /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = ""; }; 545BA70121BA3214007F7846 /* SamplesObjC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SamplesObjC.app; sourceTree = BUILT_PRODUCTS_DIR; }; 545BA70421BA3214007F7846 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 545BA70521BA3214007F7846 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -85,6 +88,8 @@ 545BA70A21BA3214007F7846 /* Main.storyboard */, 545BA70421BA3214007F7846 /* AppDelegate.h */, 545BA70521BA3214007F7846 /* AppDelegate.m */, + 4B8B69AC305E11340083E3B6 /* SceneDelegate.h */, + 4B8B69AD305E11340083E3B6 /* SceneDelegate.m */, 545BA70721BA3214007F7846 /* MainViewController.h */, 545BA70821BA3214007F7846 /* MainViewController.m */, 545BA71221BA3217007F7846 /* Info.plist */, @@ -177,6 +182,7 @@ 545BA70921BA3214007F7846 /* MainViewController.m in Sources */, 545BA71421BA3217007F7846 /* main.m in Sources */, 545BA70621BA3214007F7846 /* AppDelegate.m in Sources */, + 4B8B69AE305E11340083E3B6 /* SceneDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Examples/SamplesObjC/SamplesObjC/AppDelegate.m b/Examples/SamplesObjC/SamplesObjC/AppDelegate.m index f9cb8157d..fa6de73cb 100644 --- a/Examples/SamplesObjC/SamplesObjC/AppDelegate.m +++ b/Examples/SamplesObjC/SamplesObjC/AppDelegate.m @@ -6,4 +6,22 @@ @interface AppDelegate () @end @implementation AppDelegate +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + +#pragma mark - UISceneSession lifecycle + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} @end diff --git a/Examples/SamplesObjC/SamplesObjC/Info.plist b/Examples/SamplesObjC/SamplesObjC/Info.plist index 16be3b681..fbf94c932 100644 --- a/Examples/SamplesObjC/SamplesObjC/Info.plist +++ b/Examples/SamplesObjC/SamplesObjC/Info.plist @@ -41,5 +41,24 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + diff --git a/Examples/SamplesObjC/SamplesObjC/SceneDelegate.h b/Examples/SamplesObjC/SamplesObjC/SceneDelegate.h new file mode 100644 index 000000000..076d45e64 --- /dev/null +++ b/Examples/SamplesObjC/SamplesObjC/SceneDelegate.h @@ -0,0 +1,10 @@ +// Copyright 2026 the FloatingPanel authors. All rights reserved. MIT license. + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/Examples/SamplesObjC/SamplesObjC/SceneDelegate.m b/Examples/SamplesObjC/SamplesObjC/SceneDelegate.m new file mode 100644 index 000000000..02c7146c4 --- /dev/null +++ b/Examples/SamplesObjC/SamplesObjC/SceneDelegate.m @@ -0,0 +1,45 @@ +// Copyright 2026 the FloatingPanel authors. All rights reserved. MIT license. + +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). +} + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + +@end diff --git a/Examples/Stocks/Stocks.xcodeproj/project.pbxproj b/Examples/Stocks/Stocks.xcodeproj/project.pbxproj index 4035625c5..1f79bc930 100644 --- a/Examples/Stocks/Stocks.xcodeproj/project.pbxproj +++ b/Examples/Stocks/Stocks.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 4B8B697F305E10500083E3B6 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8B697E305E10500083E3B6 /* SceneDelegate.swift */; }; 548DF95421705BE00041922A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 548DF95321705BE00041922A /* AppDelegate.swift */; }; 548DF95621705BE00041922A /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 548DF95521705BE00041922A /* MainViewController.swift */; }; 548DF95921705BE00041922A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 548DF95721705BE00041922A /* Main.storyboard */; }; @@ -32,6 +33,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 4B8B697E305E10500083E3B6 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 548DF95021705BE00041922A /* Stocks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Stocks.app; sourceTree = BUILT_PRODUCTS_DIR; }; 548DF95321705BE00041922A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 548DF95521705BE00041922A /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; @@ -81,6 +83,7 @@ 548DF95C21705BE10041922A /* LaunchScreen.storyboard */, 548DF95721705BE00041922A /* Main.storyboard */, 548DF95321705BE00041922A /* AppDelegate.swift */, + 4B8B697E305E10500083E3B6 /* SceneDelegate.swift */, 548DF95521705BE00041922A /* MainViewController.swift */, 548DF95F21705BE10041922A /* Info.plist */, ); @@ -169,6 +172,7 @@ files = ( 548DF95621705BE00041922A /* MainViewController.swift in Sources */, 548DF95421705BE00041922A /* AppDelegate.swift in Sources */, + 4B8B697F305E10500083E3B6 /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Examples/Stocks/Stocks/AppDelegate.swift b/Examples/Stocks/Stocks/AppDelegate.swift index 57b82957b..9b555938a 100644 --- a/Examples/Stocks/Stocks/AppDelegate.swift +++ b/Examples/Stocks/Stocks/AppDelegate.swift @@ -2,8 +2,24 @@ import UIKit -@UIApplicationMain +@main class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? -} + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + true + } + + // MARK: UISceneSession Lifecycle + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } +} diff --git a/Examples/Stocks/Stocks/Info.plist b/Examples/Stocks/Stocks/Info.plist index 1c598805a..c4b618f7e 100644 --- a/Examples/Stocks/Stocks/Info.plist +++ b/Examples/Stocks/Stocks/Info.plist @@ -41,5 +41,24 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + diff --git a/Examples/Stocks/Stocks/SceneDelegate.swift b/Examples/Stocks/Stocks/SceneDelegate.swift new file mode 100644 index 000000000..577eedf72 --- /dev/null +++ b/Examples/Stocks/Stocks/SceneDelegate.swift @@ -0,0 +1,42 @@ +// Copyright 2026 the FloatingPanel authors. All rights reserved. MIT license. + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + var window: UIWindow? + + 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`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } +}