Apologies
You must be signed in to watch this lesson.
MainTabBarController + Coding Tips
Podcasts
Let's kick off the course with a very straightforward lesson in creating the main UITabBarController subclass for our application. This class will be responsible for coordinating all the pages that our user will have access to. Because we are learning how UIKit functions under the hood, we'll be learning everything programmatically. I like to start of the courses with an easier lesson. Once we get this task completed, we'll kick up the difficulty by implementing more interesting features.

Comments (24)
vegopunk
6 years ago
Amazing start! Thank you, Brian!
guleadrian
6 years ago
Great to get started, very promising course! I've eagerly waited for this ever since you talked about it on Youtube live.
Bashir SK
6 years ago
This is amazing, programmatic views seem so much better, I have been stuck on storyboards all this time. Thanks Brian
Brian Voong
6 years ago
Redoine Aito
6 years ago
Thank you, Brian شكرا جزيلا
MaurixFx
6 years ago
Hello Brian, when the next chapter?
Brian Voong
6 years ago
Huo En Ci
6 years ago
Hi Brian, for some reason, this line does not work for me in the generateNavigationController method: navigationController.navigationItem.title = title instead, this line does: navigationController.childViewControllers.first?.navigationItem.title = title ;)
Amaan Khan
6 years ago
Hey, I think it's because you wrote: navigationController.navigationItem.title = title he wrote: rootViewController.navigationItem.title = title
Huo En Ci
6 years ago
you're right. oh silly me! thanks for pointing out
humbleCoder
5 years ago
Why is it that this worked: rootViewController.navigationItem.title = title But this didn't? navigationController.navigationItem.title = title navigationController is the UINavigationController we created in generateNavigationController.
tomasurquijo
3 years ago
Still the same doubt. Anything?
Tokyojogo
6 years ago
Hi Brian, Great way to start off the course! I'm so glad you're doing refactoring right away and not waiting past midway to the project before doing it... nice!
이동건
6 years ago
hello brian! Thanks for your great videos i have one question what are differences between these two codes window = UIWindow(frame: UIScreen.main.bounds) window = UIWindow()
Brian Voong
6 years ago
Prabhdeep Singh Randhawa
5 years ago
Hi brian, Got a question not related to the course.how can we set the ap to refrefh or terminate by itself if the app is in background and not being used.at the present if my app is in background and i open it next day,it will start from same controller where i left it.
Brian Voong
5 years ago
Talia
5 years ago
Hi Brian, 请问如何改变tabBarItem.title 的字体大小呢?
Brian Voong
5 years ago
zmagdum
5 years ago
UINavigationBar.appearance() does not seem to have prefersLargeTitles. Is anything changed between iOS versions?
Brian Voong
5 years ago
gottaminute
5 years ago
This was a great video!
Brian Voong
5 years ago
petar7
5 years ago
Amazing Brian !
awjenson
5 years ago
Thanks for this course! Going forward, could you create a tutorial where you use GitHub? This way students can add these apps to our portfolios/resumes. I'd enjoy seeing how you use GitHub as you build an app. Cheers!
Brian Voong
5 years ago
Aziz80
5 years ago
The icons did not show up when I try typing their names, is their another way to add them?
albaqawi
5 years ago
same for me so strage.... and you get "Use of unresolved identifier 'favorites'" error too? example of one of them?
albaqawi
5 years ago
ok seems in Swift 4.2 things changes and we have to call the image from resources like this generateNavigationController(for: ViewController(), title: "Favorites", image: #imageLiteral(resourceName: "favorites")),
Gary Smith II
5 years ago
Where did you insert this code... it didn't work when I tried to implement this...
Govind K Kara
5 years ago
rootViewController.navigationItem.title = title is not showing in swift 4
Govind K Kara
5 years ago
Sorry it was my mistake..its showing properly
jwaples
5 years ago
How did you move from one project to another in the simulator? It looks like you dragged left to show the more completed project?
jwaples
5 years ago
At 6:58. I’ve never seen that done before. I’ll have to try it out lol
Brian Voong
5 years ago
Gary Smith II
5 years ago
Hey Brian, for some reason Xcode is not recognizing the image names from the assets folder when I try to assign the images to the tab bar controllers. As if the images weren't in the assets folder at all.
Gary Smith II
5 years ago
never mind I see that someone has answered my question
Brian Voong
5 years ago
verticon
4 years ago
Hey Brian, I'm happy to have found you and am enjoying the Podcasts tutorial. I want to make you aware of something (perhaps you already are): You use the phrase "kind a" a heck of a lot. Even when what you are referencing is not kind a but is instead exact. Its a bit like other people when they fill the space by saying "uh" or "um". You'd be better without it. Just saying :-)
Brian Voong
4 years ago
shender ramos
4 years ago
i've been dying to buy this course i just didnt have the time to follow it..... finally i did.. cant wait to start.. thanks brian for all the value....
Birchwood
4 years ago
I got stuck right at the video 2 (MainTabBarController+ Coding Tips), at minute 04:52 . I just follow exactly the same your code but when I hit run, My simulator doesn't have the green color for the background of MainTabBarController. It was just one line of code in MainTabBarController and 4 lines of code in the file AppDelegate. I don't know why it doesn't have green color for the background as yours. Hope you could help. Thanks
Brian Voong
4 years ago
Birchwood
4 years ago
Thank you Brian. It works now!!!
Birchwood
4 years ago
Hi Brian, I'm using Xcode 11, and my navigation bar doesn't have the background. Do you know how to make the navigation bar in Xcode 11? Please click on the url to know more details. Thanks! https://i.postimg.cc/9MLVS8cX/11.png
Birchwood
4 years ago
I mean even I have this statement on func generateNavigationController: let navController = UINavigationController(rootViewController: rootViewController) I still don't have horizontal line to separate my navigation bar with the main screen. I'm using Xcode 11
Brian Voong
4 years ago
Birchwood
4 years ago
Thanks Brian.
abeldemoz
4 years ago
Hi Brian, I'm stuck at the 5 minute part. I did everything as you did, but couldn't get the MainTabBarController to show up with a green background. I wen't to the scene delegate and typed the following but the build failed: func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { if let windowScene = scene as? UIWindowScene { let window = UIWindow(windowScene: windowScene) window.rootViewController = UIHostingController(rootView: contentView) window.rootViewController = MainTabBarController() self.window = window window.makeKeyAndVisible() } } }
bawasuru
3 years ago
Hey abeldemoz, try this guard let windowScene = (scene as? UIWindowScene) else { return } window = UIWindow(frame: windowScene.coordinateSpace.bounds) window?.windowScene = windowScene window.rootViewController = UIHostingController(rootView: contentView) window?.rootViewController = MainTabBarController() window?.makeKeyAndVisible()
John Buchanan
3 years ago
sorry, having the same issue. My UIHostingController and contentView are both unresolved identifiers. Are we supposed to have declared them somewhere earlier?
John Buchanan
3 years ago
Nevermind, I found that removing the line "window.rootViewController = UIHostingController(rootView: contentView)" allowed me to build and run.
ttanew
3 years ago
Hello, I bought your podcast app making class today. But when I followed your lesson "2.Podcasts - MainTabBarController + Coding Tips", It didn't work in my Simulator(I am using Xcode 12.4 now). And when I created Xcode project, "SceneDelegate.swift" file was created together and it makes me confused. What should I do? What can I modify my code to run it normally?
Brian Voong
3 years ago
ttanew
3 years ago
Okay I will try :) Thank you for replying!
HELP & SUPPORT