"More" system tab and the UITabBar delegate

I have an app using a tab bar with five tabs. I’ve just added a sixth tab which causes only four tabs to be visible alongside a system-added “More” tab which contains the fifth and sixth tabs.

The thing is, I’ve discovered that iOS adds an Edit button to the More tabs view which allows users to drag tab icons around to change the order of the tabs. There doesn’t seem to be any way to turn this option off.

So why is this a problem?

Because Xojo doesn’t expose any events to respond to these changes, which means my app is unaware of the changes and so can’t save the state of the tabs. So the next time my app runs, the tabs are back to their default positions. This will look like a bug to my users.

Accord to this Apple doc, the solution is to use the UITabBarDelegate to respond to the changes and presumably save them in a local config file (eg in NSUserDefaults, which I currently use to save preferences).

Has anybody had to solve this or done any work with the UITabBarDelegate and are you able to point me in the right direction?

Just in case anybody has this same problem, I’m posting the solution which was very kindly provided by @Travis Hill

To tell iOS that you don’t want users to be able to customise the tab bar, add this code to the relevant part of your app. In my case, it was to the Activate event of one of the views connected to my tab bar:

Dim tb As iOSTabBar = me.ParentTabBar
If tb Is Nil Then Return

Dim h As ptr = tb.ViewControllerHandle

Declare Sub setCustomizableViewControllers Lib "UIKit" selector "setCustomizableViewControllers:" (o As Ptr, v as Ptr)
setCustomizableViewControllers(h, nil)

Thank you Travis!