Changing navigation title programmatically

后端 未结 14 2197
长情又很酷
长情又很酷 2020-11-28 19:34

I have a navigation bar with a title. When I double click the text to rename it, it actually says it\'s a navigation item, so it might be that.

I\'m trying to change

14条回答
  •  迷失自我
    2020-11-28 19:55

    If you wanted to change the title from a child view controller of a Page View Controller that's embedded in a navigation controller, it would look like this:

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.parent?.title = "some title"
    }
    

提交回复
热议问题