I am using your Dog Walk tutorial as my starting point for my own project. But my app keeps crashing when I fetch data in the ViewController, Probably because I have a UITabBarController between my UINavigationController and my ViewController. I am not sure if I got this right but In my appDelegate the folowing code sets my ViewController as my rootViewController?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
guard
let navController = window?.rootViewController as? UINavigationController,
let viewController = navController.topViewController as? ViewController else
{
return true
}
viewController.managedContext = coreDataStack.managedContext
return true
}
If I remove my UITabBarController it runs fine but I need to have the UITabbar, so I reckon I have to make some changes to the above code? Please lead me in the right direction.
thanks,
Joachim