Boon
Boon

Reputation: 41470

UINavigationController and UINavigationItem

Apple's documentation on UINavigationItem states the following:

The managing UINavigationController object uses the navigation items of the topmost two view controllers to populate the navigation bar with content.

Why the topmost two view controllers instead of just the topmost? Is it just so that when you pop the view controller, it fades one item out and another in?

Upvotes: 1

Views: 28

Answers (1)

Nicolas Miari
Nicolas Miari

Reputation: 16246

I think it's because the title of the "Back" button is (by default) the navigation title of the view controller just underneath the top one.

  • Navigation title: Title of top view controller.
  • Back Button title: Title of previous view controller.

Upvotes: 1

Related Questions