我可以从自定义视图类更改 NavigationController 设置吗

问题描述

我可以从自定义视图类更改 NavigationController 设置吗?

import UIKit

class TutorialView: UIView {
  init() {
    //change navigation controller settings
    //ex: navigationController.navigationItem.title = "hoge"
  }
}

我知道这种方式。但是我的应用程序 rootViewController 是 TabBarController。 TabBarController 上的 NavigationController。

(window?.rootViewController as? UINavigationController)?.navigationItem.title = "hoge"

最好以何种方式更改 NavigationController 设置?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)