I am having problems finding any other information than the docs for how to save the tab order for my UITabBarController, so that the user\'s customization is saved for next
Simplified Rickard Elimää answer even further. "Swift" solution to saving and loading Customized ViewControllers using the delegate function of tabBarController CustomizingViewControllers.
This is how I did it.
class TabBarController: UITabBarController, UITabBarControllerDelegate {
let kOrder = "customOrder"
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
loadCustomizedViews()
}
func loadCustomizedViews(){
let defaults = NSUserDefaults.standardUserDefaults()
// returns 0 if not set, hence having the tabItem's tags starting at 1.
let changed : Bool = defaults.boolForKey(kOrder)
if changed {
var customViewControllers = [UIViewController]()
var tagNumber: Int = 0
for (var i=0; i