Skip to content

Commit

Permalink
Revert "feat(ios): support multi-scene applications (#13941)"
Browse files Browse the repository at this point in the history
This reverts commit bfc87a6.

Revert "fix(ios): fix debug issues with scenes (#13979)"

This reverts commit 8bcd5c3.

Revert "fix(ios): fix various issues related to the scene migration (#13981)"

This reverts commit 6e40edb.

Revert "fix(ios): restore compatibility for Ti.App._resumeRestart() (#13989)"

This reverts commit 3a44b3d.

Revert "fix(ios): fix some open issues related to scenes (#14020)"

This reverts commit a0a3aea.

chore: restore start sequence

# Conflicts:
#	iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.h
#	iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.m
  • Loading branch information
hansemannn committed May 26, 2024
1 parent 570442b commit 8570d92
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 183 deletions.
23 changes: 4 additions & 19 deletions iphone/Classes/AppModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,9 @@ - (void)_resumeRestart:(id)unused
#ifndef TI_USE_AUTOLAYOUT
[TiLayoutQueue resetQueue];
#endif

// Get the currently active scene
UIScene *activeScene = nil;
for (UIScene *scene in UIApplication.sharedApplication.connectedScenes) {
if (scene.activationState == UISceneActivationStateForegroundActive) {
activeScene = scene;
break;
}
}

if (activeScene == nil) {
NSLog(@"[ERROR] No active scene connected - this may lead to an undefined behavior");
}

/* Begin backgrounding simulation */
[appDelegate sceneWillResignActive:activeScene];
[appDelegate sceneDidEnterBackground:activeScene];
[appDelegate applicationWillResignActive:app];
[appDelegate applicationDidEnterBackground:app];
[appDelegate endBackgrounding];
/* End backgrounding simulation */

Expand All @@ -90,9 +76,8 @@ - (void)_resumeRestart:(id)unused

/* Begin foregrounding simulation */
[appDelegate application:app didFinishLaunchingWithOptions:[appDelegate launchOptions]];
[appDelegate scene:activeScene willConnectToSession:activeScene.session options:TiApp.app.connectionOptions];
[appDelegate sceneWillEnterForeground:activeScene];
[appDelegate sceneDidBecomeActive:activeScene];
[appDelegate applicationWillEnterForeground:app];
[appDelegate applicationDidBecomeActive:app];
/* End foregrounding simulation */
}

Expand Down
17 changes: 8 additions & 9 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@
#import "TiRootViewController.h"
#import <JavaScriptCore/JavaScriptCore.h>

extern BOOL applicationInMemoryPanic; // TODO: Remove in SDK 9.0+

// TODO: Remove in SDK 9.0+
TI_INLINE void waitForMemoryPanicCleared() //WARNING: This must never be run on main thread, or else there is a risk of deadlock!
{
}

/**
TiApp represents an instance of an application. There is always only one instance per application which could be accessed through <app> class method.
*/
@interface TiApp : TiHost <UIApplicationDelegate, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDownloadDelegate, UNUserNotificationCenterDelegate, UIWindowSceneDelegate> {
@interface TiApp : TiHost <UIApplicationDelegate, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDownloadDelegate, UNUserNotificationCenterDelegate> {
UIWindow *window;
UIImageView *loadView;
UIView *splashScreenView;
Expand All @@ -26,7 +33,6 @@
KrollBridge *kjsBridge;

NSMutableDictionary *launchOptions;
UISceneConnectionOptions *_connectionOptions;
NSTimeInterval started;

int32_t networkActivityCount;
Expand Down Expand Up @@ -113,13 +119,6 @@
*/
@property (nonatomic, readonly) NSDictionary *localNotification;

/**
Returns details for the last remote notification.
Dictionary containing details about remote notification, or _nil_.
*/
@property (nonatomic, readonly) UISceneConnectionOptions *connectionOptions;

/**
Returns the application's root view controller.
*/
Expand Down
Loading

0 comments on commit 8570d92

Please sign in to comment.