How to remember last selected tab in UITabBarController?

前端 未结 6 1622
小鲜肉
小鲜肉 2021-02-08 04:30

I\'m trying to make my app remember which tab was last being viewed before the app quit, so that the app opens up to the same tab when it is next launched. This is the functiona

6条回答
  •  情书的邮戳
    2021-02-08 05:08

    Store the selected tab index in the NSUserDefaults preferences each time the user selects a new tab. Then when the app starts back up, load that value from the preferences and manually select that tab.

提交回复
热议问题