Group Group Group Group Group Group Group Group Group

Chapter 27 p644 for swift version 4.2. find UITabBarController

@fahim and everyone:

Hi, I have added a new view controller to the my location app, now the UITabBarController is not the root view controller anymore, how can I keep the code valid?

In the book says I first have to find the UITabBarController, how to find it?
let tabController = UITabBarController as! UITabBarController something like that?

I have given the TabBarController an storyboard id “AppContent”, but unable to call it.
Please help.

Thanks

Please help, anyone?

Hi, this topic is solved, I watched the youtube video made by Kilo Loco, https://www.youtube.com/watch?v=tP4OGvIRUC4&t=1296s, solved by creating a singleton, I called it persistence service, next moved all of the core data related methods from app delegate to the singleton, and change them to static.

Now because the app is designed with dependancy injection, for every NSManagedObjectContext in all the views, just call the static context, so no need to locate the view again.

@jdfocus1985 Glad you were able to solve this and also thank you for sharing how you found your solution.

Hi, thanks for the reply, learners like me need many app for practicing, and iOS apprentice is a great book. Wish that I can learn how to build a translator app.