Select no tabs in a UITabBar

后端 未结 7 1568
心在旅途
心在旅途 2020-12-06 19:23

I\'m trying to select no tabs at all in my application. At first the first tab is selected, but I\'d like to deselect it so no tabs at all would be selected.

Don\'t

7条回答
  •  没有蜡笔的小新
    2020-12-06 19:56

    I just came across this question and it's actually really simple:

    tabBarController.selectedViewController = viewController;
    

    This is somewhat similar to HG's answer, but setting the selected view controller to nil is unnecessary.

提交回复
热议问题