Remove TabBar item in Swift

前端 未结 5 1206
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-06 05:17

I currently try to find a way to remove while run the app a TabBar Item, i found a way to enable or disable it but not to complete remove it.

For disable it i do:

5条回答
  •  攒了一身酷
    2020-12-06 05:42

    For those who just want to disable one item. Use this code from @Daniele's solution. and place it in your UITabBarController class

    viewDidLoad() {
    
    let index = 0 //0 to 5
    viewControllers?.remove(at: index)
    
    }
    

提交回复
热议问题