I'll tell you right now, there's nothing more boring than a black and white list. Without any UI design, the apps you build will look amateur regardless of how good the technology is. Today's lesson will show you a few easy techniques that will make your application "pop". Remember that your portfolio of projects should look professional, this means that you will need to clean up all of your screens to make them as presentable as possible before you submit them.
### Xcode 11.3+ SceneDelegate Update 4/20/2020 As most of you are probably aware by now, starting with Xcode 11.3, Single View Application projects are now created with a SceneDelegate file. This file is used to manange the scenes in your application and thus also contains the entry point of your app. Because of this change, we'll need to go about setting up our project using **SceneDelegate** instead of **AppDelegate**. More specifically, you want to leave **AppDelegate** alone and instead make the following changes in **SceneDelegate**: ```swift class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { if let windowScene = scene as? UIWindowScene { let window = UIWindow(windowScene: windowScene) window.rootViewController = MainController() // Place your root view controller here self.window = window window.makeKeyAndVisible() } } } ```

Comments (42)
taha.oraei
5 years ago
Hi and thank you for fantastic course. one: is there any way to set large title in navigationBar in the right side (for right to left language)? two: i used a searchController in navigation but i should scroll to show that. i want fix it in navigation?
Brian Voong
5 years ago
Roger Price
5 years ago
Fabulous - love it!
Brian Voong
5 years ago
Dreamthinklive@hotmail.com
5 years ago
Loved it so far but it seems hard to follow along because its all in code and it's so fast.
Sergey Tereshkin
5 years ago
if only there was a pause button... ;-)
pboabang@gmail.com
5 years ago
lol
pboabang@gmail.com
5 years ago
if you have not taken the Basic (Kindle App) cause I suggest you do, it make this cause much much easy.
Pavlos Nicolaou
5 years ago
Amazing Course so far Brain! Great Job
code_seeker
5 years ago
Great lesson so far Brian, I'm enjoying it so far.
Juanpablo Macias
5 years ago
Awesome tutorial. I am looking forward to becoming a better programmer! Lets do it!
Daniel Peach
5 years ago
At what point does the ViewController get the navigationItem? How does the navigationItem know it belongs to ViewController? I would expect to see us having to create the navigaitonItem in order to use it. Trying to wrap my head around this. What I would expect: let navItem = UINavigationItem(title: "Companies", rootViewController: ViewController) navItem.leftBarButtonItem = ... (this would make sense to me as it is clear how the navItem know what controller it belongs to) But instead what we get is: navigationItem.title = "companies" ... (This throws me for a loop, bc where did navigationItem even come from?)
Brian Voong
5 years ago
Daniel Peach
5 years ago
Ok, that makes sense. So what happens to my project if I try to access self.navigationItem, but my ViewController is not in a NavigationController?
Brian Voong
5 years ago
anmol
5 years ago
Hey Brian Anmol this side. I started watching this course now after buying it over a month ago. I want to add show another method which requires much less line and can be easily understood. You can call the barStyle on navigationBar to make title, status bar to white. Also you can call all these methods in AppDelegate to change navigation bar through out the app. (I believe you'll make this change in future though.) Only 3 lines of code to modify style of navigation bar: UINavigationBar.appearance().barTintColor = lightRed UINavigationBar.appearance().isTranslucent = false // this makes the title, status bar etc to white UINavigationBar.appearance().barStyle = .black I hope you find this helpful. Thank you. :)
Brian Voong
5 years ago
anmol
5 years ago
Ah! Okay. Thought so. :) Waiting for Tinder course too sir. :D It will be paid too? Will happily buy it. :)
Brian Voong
5 years ago
anmol
5 years ago
Wow. That's great news. :D Paid would have been cool too. When it is coming? It'll be a one day launch or weekly basis episodes? I know it takes a lot of time to make a single video but you've been teasing it for a long time, might have finished it.
jesseIOS17
5 years ago
.prefersLargeTitles seems not to work anymore.
dclawson
5 years ago
Interesting. I just tried it, and it seems to work?
DiegoOruna
4 years ago
Works perfectly
magic
5 years ago
As Always a great tutorial!!
Tony Nguyen
5 years ago
Hi mate, the new website looks great, but could you please include a feature to hide side menus (to the left and right of yourvideo)? i watch these videos on half of my desktop screen (the other half is for xcode), and the videos are very small because the side menus. cheers.
Dekatria
4 years ago
Just purchased the course and finished lesson 1. It is really nice to see a programmer construct the view controller programatically. Great pace and very well explained. On to lesson 2 :)
kazu
4 years ago
Nice tutorial! If someone else is having trouble like me adding icons from assets, the new way is to reference it like this: UIBarButtonItem(image: UIImage(named:"plus")
Brian Voong
4 years ago
emekalionel
4 years ago
This is my first paid course I am watching. I am really enjoying it. Great job Brian.
ravikanth.marri@gmail.com
4 years ago
Great Tutorial Brian , Thanks
xuhua
4 years ago
谢谢老师,超级好!
Brian Voong
4 years ago
xuhua
4 years ago
新年快乐!
Beetroot
4 years ago
11:30 navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white] changed to navigationController?.navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
iyepez
4 years ago
Thank you for the great work. Your course is helping me a lot.
Caroline Kuo
4 years ago
I’m not seeing NSAttributedStringKey. ???
Brian Voong
4 years ago
Caroline Kuo
4 years ago
Thank you! I’m loving your course
Caroline Kuo
4 years ago
How to comment out 10 lines by highlighing all and then poof they are all // in the front?
Brian Voong
4 years ago
Caroline Kuo
4 years ago
Why isn’t it showing up when I try to add the plus image? I did add the plus@2 image into the assets folder
Brian Voong
4 years ago
Caroline Kuo
4 years ago
It’s not accepting the name of the plus*.png file Why?
Caroline Kuo
4 years ago
I did it! That worked. Great videos. Really impressed. You’ve practically replaced yourself... robotized yourself ...
Jose Jonas Abesamis
4 years ago
Ok I watched the https://youtu.be/AVY1PXGqBN0 video for handling image assets, but I'm not comfortable clicking/dropping images. I used to use UIImage(name: "nameOfImage") for simplicity. But now that I've learned that its returning an optional value I'm using UIImage(imageLiteralResourceName: "nameOfImage"). Brian if you have time, can you tell me if this is ok, or do I have to start using the image method in this video https://youtu.be/AVY1PXGqBN0. My code for the navBar Button: navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(imageLiteralResourceName: "plus").withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(handleAddCompany)) OR if I want to call the image multiple times I use this. let rightPlusButton : UIImage = { let Plus = UIImage(imageLiteralResourceName: "plus") return Plus }() navigationItem.rightBarButtonItem = UIBarButtonItem(image: rightPlusButton.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(handleAddCompany))
Brian Voong
4 years ago
Jose Jonas Abesamis
4 years ago
thanks Brian.
ga
4 years ago
Thanks for showing why things DON'T work, like the override of preferredStatusBarStyle and how to fix it. That would have probably stumped and frustrated me. Your classes are worth the price!
jdhindsa
4 years ago
When you click the "Download Project" button in each course, all the code is already completed? Are we supposed to create our own project from scratch and then follow along? I'm not quite sure...
Brian Voong
4 years ago
hcri1950
4 years ago
I am in the process of creating my App and having difficulty in having the NavigationalBarTitle to be Center. All previous methods of dealing with text seem not to work.
Brian Voong
4 years ago
hcri1950
4 years ago
Please ignore my question
hcri1950
4 years ago
I discovered that. I LOVE YOU COURSE. And anxious to see that converted to Swift.
hcri1950
4 years ago
Hi Brian, making great progress and I am wondering if you have a course that you teach on Scrollview in the Horizontal swipe? At present time, I had my other Swift program working great using the layouts. But creating one from scratch the documentation is nil. If you do not have a course that illustrates the Horizontal Scroller. Could you direct me to where I would be able to grasp on how it works? Sincerely, Robert
Brian Voong
4 years ago
hcri1950
4 years ago
Thank you VERY VERY MUCH, Brian. Just what the doctored ordered. I will not be using it this week. But as soon as I have got my first TableView loaded from CoreData I will start on it.
hcri1950
4 years ago
Did I read this correctly, that I can use CollectionViews instead of a TableView? For I have 4 tableViews
Douglas Moreira
4 years ago
Hi Brian! Awesome tutorial. I am looking forward to becoming a mobile programmer! I'm new here! so... Could you tell me why until today we need to use a @objc function? There is not other way to do that? navigationItem.rightBarButtonItem = UIBarButtonItem(image: #imageLiteral(resourceName: "plus"), style: .plain, target: self, action: #selector(handleAddButton)) @objc func handleAddButton(){ print("Adding company") } Thanks! Hugs from Brazil!
Abdullah Amer II
3 years ago
Hello Brian, I have a question here, what I wanna do is that doing the same of what you do by customising the navViewBar but to a page in the app, not in the main story board, here is the question, Should I customise it as you done from AppDelegate?
Brian Voong
3 years ago
Abdullah Amer II
3 years ago
In my app that I designed I had used the Navigation Controller from the library, should I remove that I use your way? I use the Navigation controller just for having the Back button to send me back to the home page.
Brian Voong
3 years ago
Abdullah Amer II
3 years ago
Sorry, when I reach till here to minute 10 and I run the code the nav bar keep showing in gray color and the background in black color. I cannot figure out my mistake.
Abdullah Amer II
3 years ago
Sorry, just ignore my question...I figured it out...
frankusu
3 years ago
For those who have trouble with color changing to black when you use prefersLargeTitles in iOS 13.0 I found a solution https://stackoverflow.com/questions/56910797/ios13-navigation-bar-large-titles-not-covering-status-bar let lightRed = UIColor(red: 247/255, green: 66/255, blue: 82/255, alpha: 1) navigationItem.title = "Companies" navigationController?.navigationBar.prefersLargeTitles = true let appearance = UINavigationBarAppearance() appearance.backgroundColor = lightRed appearance.largeTitleTextAttributes = [.foregroundColor : UIColor.white] //portrait title appearance.titleTextAttributes = [.foregroundColor : UIColor.white] //landscape title navigationController?.navigationBar.standardAppearance = appearance //landscape navigationController?.navigationBar.compactAppearance = appearance navigationController?.navigationBar.scrollEdgeAppearance = appearance //portrait
Malikov_Vladimir
3 years ago
Thank you bro!) good job)
Mattliu
3 years ago
cool
Mattliu
3 years ago
hi brian, is it really wise to learn UIKIT now? I just found some code introduced in this course already not working. for example, that bartintcolor. i don't know why. btw 我可以说中文么?
Brian Voong
3 years ago
Mattliu
3 years ago
thanks, brain . 好的,多谢
Brian Voong
3 years ago
Mattliu
3 years ago
太好了,looking forward to that.
Yamak
3 years ago
Hey Brian, I hope you are doing well. Thank you for your videos and classes. I am new to programming and eager to learn. I have no background in at all, however, I have been learning slowly for the past two years at my own pace. I bought this course to understand core data and to get a better understanding in how to manager data inputs/export. This is done in UIKit, do you think you will be able to provide something for SwiftUI? The second video shows how to make a custom window in AppDelegate, but I think it is done differently in SwiftUI. Any guidance will be appreciated.
Brian Voong
3 years ago
Yamak
3 years ago
Wow! Awesome, thanks for responding so quickly! ?? Are there any other road blocks in the lesson between UIKit and SwiftUI that I should be aware of?
Yamak
3 years ago
Hey Brian, I am having trouble getting the title "Companies" to render in the navbar. I am able to get the red background to render for the navbar and white background. I looked through the code in the completed "Project Download" but was not able to follow. The overall code that I have looks similar to what is in the completed one. I was hoping you could have a look at it and let me know what I am doing wrong. Appreciate your help! ContentView: import UIKit class CustomNavController: UINavigationController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .white navigationItem.title = "Companies" UINavigationBar.appearance().barTintColor = .red let lightRed = UIColor(red: 247/255, green: 66/255, blue: 82/255, alpha: 1) UINavigationBar.appearance().tintColor = .white UINavigationBar.appearance().prefersLargeTitles = true UINavigationBar.appearance().barTintColor = lightRed if #available(iOS 13.0, *) { let appearance = UINavigationBarAppearance() UINavigationBar.appearance().tintColor = .white appearance.backgroundColor = lightRed appearance.largeTitleTextAttributes = [.foregroundColor : UIColor.black] //portrait title appearance.titleTextAttributes = [.foregroundColor : UIColor.white] //landscape title UINavigationBar.appearance().tintColor = .white UINavigationBar.appearance().standardAppearance = appearance //landscape UINavigationBar.appearance().compactAppearance = appearance UINavigationBar.appearance().scrollEdgeAppearance = appearance //portrait } else { UINavigationBar.appearance().isTranslucent = false UINavigationBar.appearance().titleTextAttributes = [.foregroundColor: UIColor.white] UINavigationBar.appearance().largeTitleTextAttributes = [.foregroundColor: UIColor.white] } } } SceneDelegate: import UIKit import SwiftUI class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { if let windowScene = scene as? UIWindowScene { let window = UIWindow(windowScene: windowScene) window.rootViewController = CustomNavController() self.window = window window.makeKeyAndVisible() } } }
Brian Voong
3 years ago
Yamak
3 years ago
Thanks Brian, Really appreciate your quick reply! I'll have a look at the sample code.
diegoseb
3 years ago
Hi Brian, I'm interested at buying this course. Has CoreData had any substantial changes in swift 5 since you recorded this course? Thank you
Brian Voong
3 years ago
alpharisk
3 years ago
Hi Brian: I am unfortunately stuck at step 1. Using the code in the video where the window should change to blue, it is still yellow. After ensuring my code matched yours, I thought it might be a version issue, so I replaced the entire AppDelegate with the revised code you have provided in the samples. I compile fine but when run, the background stays yellow. I have not changed any other code. I am on XCode 11.6. Any thoughts? Thanks!
Brian Voong
3 years ago
arroyot24
3 years ago
Hello! I'm starting with your lesson and I can't make navBar appear, as in 8:15 in video. Going on with the customization and no bar at all. Any suggestion? Thanks.
arroyot24
3 years ago
I've checked on StoryBoard just in case, and there it marked as "Ineferred". I've tried changing to different options, without success.
arroyot24
3 years ago
OK: I've copied your AppDelegate and SceneDelegate key code and now I can go on. Great!
Gugu
2 years ago
What do i need to write instead of "MainController()"? I understand I have to place my root view controller there but what is it?
Gugu
2 years ago
Hey Brian! I really liked your calculator video and therefore decided to buy this course, I copy-pasted the code above in SceneDelegate but I get plenty of errors and the navbar doesnt even show up. Could you help me out? I would really appreciate it. Thank you
Gugu
2 years ago
I did everything you did but I didnt get the same results
Brian Voong
2 years ago
Benny Lee
2 years ago
Just purchased the course. Need a little help it is probably due to version of Xcode. The following code produces the red bar with black title view.backgroundColor = .yellow navigationItem.title = "Companies" navigationController?.navigationBar.barTintColor = .red navigationController?.navigationBar.isTranslucent = false BUT navigationController?.navigationBar.prefersLargeTitles = true navigationController?.navigationBar.barTintColor = .red navigationController?.navigationBar.isTranslucent = false produces black bar and black text! xcode: version 12.5 simulator: 14.5
Benny Lee
2 years ago
Forget about my last post...got it!
HELP & SUPPORT