// // RootViewController.swift // App // // Created by 秋星桥 on 2024/11/18. // import UIKit @objc class RootViewController: UINavigationController { override init(rootViewController _: UIViewController) { fatalError() // "you are not allowed to call this" } override init(navigationBarClass _: AnyClass?, toolbarClass _: AnyClass?) { fatalError() // "you are not allowed to call this" } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) commitInit() } override init(nibName _: String?, bundle _: Bundle?) { fatalError() // "you are not allowed to call this" } func commitInit() { assert(viewControllers.isEmpty) viewControllers = [AFFiNEViewController()] } override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .systemBackground } }