- AppCoordinator:2s 节流 + 栈深 < 2 守门 + .subGameDidReturn 通知名(Design §2.4.3) - SubGameViewController:复用 BridgedWebView/Splash/16:9 letterbox/ExternalSubscriptions, AppDataWriter(.subGame) 写 4 个 app_*.js;H5 未安装时抛错(待 commit B 接入下载) - SwitchOverGameHandler:解 Gamedirectory/gamedownloadurl/data → AppCoordinator.showSubGame (msext NewRootVC.m:541-566 等价,节流与栈深由 Coordinator 守门,cb 字面始终回) - SceneDelegate:UINavigationController 承载大厅,nav 引用交给 AppCoordinator - Plan 进度已勾选 §5 / §8(commit B/C 留待 SubGameDownloader 与 backgameData/getWebdata 链路) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
32 lines
1.0 KiB
Swift
32 lines
1.0 KiB
Swift
//
|
||
// SceneDelegate.swift
|
||
// ylgamehall
|
||
//
|
||
|
||
import UIKit
|
||
|
||
final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||
|
||
var window: UIWindow?
|
||
|
||
func scene(_ scene: UIScene,
|
||
willConnectTo session: UISceneSession,
|
||
options connectionOptions: UIScene.ConnectionOptions) {
|
||
guard let windowScene = scene as? UIWindowScene else { return }
|
||
let window = UIWindow(windowScene: windowScene)
|
||
|
||
// 用 UINavigationController 承载大厅,便于 Phase 6 push 子游戏 / Phase 7 push 弹层。
|
||
// 栈深约束 ≤ 3(Design §2.4.3),由 AppCoordinator 在 push 处守门。
|
||
let lobby = WebContainerViewController()
|
||
let nav = UINavigationController(rootViewController: lobby)
|
||
nav.setNavigationBarHidden(true, animated: false)
|
||
nav.interactivePopGestureRecognizer?.isEnabled = false
|
||
|
||
AppCoordinator.shared.navigationController = nav
|
||
|
||
window.rootViewController = nav
|
||
self.window = window
|
||
window.makeKeyAndVisible()
|
||
}
|
||
}
|