Pregunta

Is there a way to automatically set the tab bar and toolbar titles using the title of the View Controller?

I'm currently manually double clicking the tab bar titles to rename it from Item to the title of the View Controller it points to, and then also doing the same thing for the toolbars. I was thinking it'd be nice if it would be set automatically based on the title of the View Controller (settable in the sidebar). It seems a bit silly to have the exact same text in three locations - it'd be a good opportunity for a typo or inconsistency between the three.

enter image description here

¿Fue útil?

Solución

You can add self.navigationItem.title = self.title; to the - (void)viewWillAppear:(BOOL)animated of each one of your's UIViewController.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top