我正在开发一个应用程序,其中用户操作应导致TabController选项(图标)从 5 个减少到 3 个。
我了解修改所需的代码TabController但无法强制它刷新(viewDidLoad),因为ViewController用户交互的地方是选项卡控制器下游的几个步骤(流程也包括 a NavController)。因此
self.tabBarController?.viewDidLoad()
似乎不起作用。
这是我的代码:
print("pressed tab refresh")
print(self.tabBarController)
//this next line confirms that I can "see" the tab controller in question
print(self.tabBarController?.title)
//expect this to work
self.tabBarController?.viewDidLoad()
//trying this as well
var setTBC = self.tabBarController
setTBC?.delegate = self
setTBC?.viewDidLoad()