Storyboard navigation controller and tab bar controller

后端 未结 5 1276
情歌与酒
情歌与酒 2020-12-08 11:12

I am trying to get the following setup in Storyboard.

\"Storyboard\"

Where I have a table view in the b

5条回答
  •  孤街浪徒
    2020-12-08 11:38

    Just in case anyone was looking for a swift approach:

    tabBarController?.title = "Your Title"
    tabBarController?.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Right Button Title", style: UIBarButtonItemStyle.Plain, target: self, action: "rightButtonFunction")
    

    The code is best placed in viewDidAppear or viewWillAppear so the title and button change as the different tabs are pressed.

    You also wouldn't need the extra navigation controllers with this approach.

提交回复
热议问题