0

I'm just getting in to programmatic vc's with no more storyboards and I'm following YouTube's LetsBuildThatApp by Brian Voong for guidance https://youtu.be/NJxb7EKXF3U?list=PL0dzCUj1L5JHDWIO3x4wePhD8G4d1Fa6N.

I followed all the directions and for some reason when I launch my app I get this light gray haze over my screen and I can't figure out why? I can faintly see the navigation title and blue background but it's covered by a faded layer.

Step 1: I deleted my storyboard file and sunder the General Tab under Deployment Info I deleted "Main" from Main Interface.

Step 2: I changed my ProjectNavigator file to FeedController then Changed the file accordingly

import UIKit

class FeedController: UICollectionViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        navigationItem.title = "Facebook Feed"
        collectionView?.backgroundColor = UIColor.white
    }
}

Step 3: In AppDelegate I added a NavVC and made FeedVC it's root and made the NavVC the Window's root. I also change the NavBar and StatusBar color

class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.

        window = UIWindow(frame: UIScreen.main.bounds)
        window?.makeKeyAndVisible()

        let feedController = FeedController(collectionViewLayout: UICollectionViewFlowLayout())
        let navVC = UINavigationController(rootViewController: feedController)
        window?.rootViewController = navVC

        UINavigationBar.appearance().tintColor = UIColor.blue
        UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white]
        application.statusBarStyle = .lightContent

        return true
    }

Step 4: In info.plist I set View controller-based status bar appearance to NO

I can't figure out why I get this light gray haze over my screen

enter image description here

What am I missing here?

Lance Samaria
  • 17,576
  • 18
  • 108
  • 256

1 Answers1

1

It looks like you are configuring the tintColor instead of the barTintColor. The tintColor changes the color for the navigation buttons and the barTintColor adjusts the navigation bar background color. You can watch this video for more details on customizing navigation bar appearance.

https://www.youtube.com/watch?v=RO8_mqRJO-4

Jack Ngai
  • 157
  • 1
  • 9