Matthew Kennedy
Matthew Kennedy

Reputation: 616

Persist iOS Tab Bar More Page

I have an app that has more than 5 tabs in a tab bar, so it has the standard more page as the last tab item. The edit button lets you rearrange the tabs so that you can have the four that you want down in the bar. This works fine. When you rearrange the tabs, then exit the app, your new order is not persisted between restarts. I've noticed that some of the apps that I have (from the App Store) persist the tab layout, and I am wondering if there is a standard way of doing this.

The UITabBarController (and its child tabs) I'm using is in a storyboard, if the implementation depends upon that.

Upvotes: 0

Views: 270

Answers (1)

Dima
Dima

Reputation: 23634

Something like this should be the way to go. You have to do it manually.

Just find some way to distinguish each tab (usually a title for that view controller), and keep an array of those identifiers, which you will persist to user defaults. Then when you recreate the tabs on a new app launch, use the order from that array to add them to your tab bar controller.

Upvotes: 1

Related Questions