Refactor AppServices into grouped bundles and document DI conventions.
Centralize dependency wiring with Session/Context/Network/UI/Runtime bundles, unify leaf ViewControllers on appServices, and add a test initializer with AppServicesTests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -9,8 +9,6 @@ import UIKit
|
||||
/// ViewController 通用工具,封装 Toast、Loading 和 ViewModel 绑定。
|
||||
@MainActor
|
||||
enum ViewControllerHelpers {
|
||||
static var services: AppServices { AppServices.shared }
|
||||
|
||||
/// 绑定 ViewModel 的 onChange 回调并在 deinit 时自动清理。
|
||||
static func bind(onChange: (() -> Void)?, owner: AnyObject, handler: @escaping () -> Void) {
|
||||
onChange?()
|
||||
|
||||
Reference in New Issue
Block a user