0

I´m just a beginner in Swift and i don´t get it. Why doesn't change the title of my backBarButtonItem after the push segue?

I tried it with this code in the viewDidLoad:

navigationItem.backBarButtonItem?.title = "Back"

Can somebody help me?

Tom Kuschka
  • 463
  • 1
  • 8
  • 17

1 Answers1

1

Use ! not ?. ! is used for getting value from optional or unwrapping the optional

 self.navigationItem.backBarButtonItem!.title = "Back"
codester
  • 36,891
  • 10
  • 74
  • 72