Integrate CYLTabBar center scan button and unify UIKit navigation.

Add CYLTabBarController with a global scan entry, promote MainTabBarController to the window root after login, replace RouterPath-based navigation with AppNavigator, and fix Profile diffable cell reconfiguration crashes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 16:36:18 +08:00
parent 24a7339b68
commit a1c031c9b7
31 changed files with 838 additions and 517 deletions

View File

@ -19,42 +19,16 @@ enum HomeMenuRouting {
let services = AppServices.shared
switch route {
case .tab(let tab):
services.appRouter.select(tab)
services.appNavigator.selectTab(tab)
case .orders(let entry):
services.appRouter.selectOrders(entry: entry)
services.appNavigator.openOrdersEntry(entry)
case .destination(let homeRoute):
push(homeRoute, from: viewController)
services.appNavigator.push(.home(homeRoute), from: viewController)
case .unsupported(let uri, let title, _):
pushPlaceholder(title: title, uri: uri, from: viewController)
services.appNavigator.push(.home(.modulePlaceholder(uri: uri, title: title)), from: viewController)
case .placeholder(let uri, let title):
HomeRouteDiagnostics.recordUnknown(uri: uri, title: title)
pushPlaceholder(title: title, uri: uri, from: viewController)
services.appNavigator.push(.home(.modulePlaceholder(uri: uri, title: title)), from: viewController)
}
}
/// Push
static func push(_ route: HomeRoute, from viewController: UIViewController) {
let target = AppRouteViewControllerFactory.makeViewController(for: route, services: AppServices.shared)
viewController.navigationController?.pushViewController(target, animated: true)
}
/// Push
static func pushOrders(_ route: OrdersRoute, from viewController: UIViewController) {
let target = AppRouteViewControllerFactory.makeViewController(for: .orders(route), services: AppServices.shared)
viewController.navigationController?.pushViewController(target, animated: true)
}
/// Push
static func pushProfile(_ route: ProfileRoute, from viewController: UIViewController) {
let target = AppRouteViewControllerFactory.makeViewController(for: .profile(route), services: AppServices.shared)
viewController.navigationController?.pushViewController(target, animated: true)
}
/// Push Placeholder
private static func pushPlaceholder(title: String, uri: String, from viewController: UIViewController) {
viewController.navigationController?.pushViewController(
FeaturePlaceholderViewController(title: title, uri: uri),
animated: true
)
}
}

View File

@ -368,7 +368,7 @@ final class HomeViewController: UIViewController {
///
@objc private func scenicTapped() {
HomeMenuRouting.push(.scenicSelection, from: self)
appServices.appNavigator.push(.home(.scenicSelection), from: self)
}
/// 线 / 线