-
-
Notifications
You must be signed in to change notification settings - Fork 401
fix: Adopt scene lifecycle in sample apps #8351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
denrase
wants to merge
9
commits into
main
Choose a base branch
from
fix/ios-27-scene-lifecycle-sample-app
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+379
−203
Open
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d8d02cd
fix: Adopt scene lifecycle in sample apps
denrase 50bd738
migrate tvos
denrase d42066f
fix watchos
denrase 31a3cfe
Merge branch 'main' into fix/ios-27-scene-lifecycle-sample-app
denrase 2436424
mirror the scene window to AppDelegate.window for shared sample helpers
denrase c1bcbd0
modernize sample app scene lifecycle
denrase 212cd09
Merge branch 'main' into fix/ios-27-scene-lifecycle-sample-app
denrase 1c4d233
revert WATCHOS_DEPLOYMENT_TARGET[sdk=watchsimulator*]
denrase 074b0b2
remove feeback callback alters
denrase File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
18
Samples/iOS-ObjectiveC-Dynamic/App/Sources/SceneDelegate.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Samples/iOS-ObjectiveCpp-NoModules/App/Sources/SceneDelegate.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
18
Samples/iOS-ObjectiveCpp-NoModules/App/Sources/SceneDelegate.mm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
denrase marked this conversation as resolved.
Outdated
|
||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.