In this chapter we see how we can insert a UINavigationController for out UITableView.
I am trying to expand the program and insert a UITabBarController before but the debugger stops at the following code in AppDelegate - func application(_ application: UIApplication, didFinishLaunchingWithOptions):
//Create an ItemStore
let itemStore = ItemStore()
let navController = window!.rootViewController as! UINavigationController
let itemsController = navController.topViewController as! ItemsViewController
itemsController.itemStore = itemStore
The error message I get is that it can’t cast the UITabBarViewController (the window!) to type of UINavigationController. I have tried to fix this problem but then I am having all other type of problems.
Any assistance would be much appreciated.