override func viewWillAppear(_ animated: Bool)
{        
    if let colorHex = selectedCategory?.color
    {        
        title = selectedCategory?.name
            
        guard let navBar = navigationController?.navigationBar.scrollEdgeAppearance else 
        {
            fatalError("Navigation Controller does not exist")
        }
            
        if let navBarColor = UIColor(hexString: colorHex)
        {
            navBar.backgroundColor = navBarColor
            // ERROR IN THIS LINE-Reference to member 'tintColor'
            // cannot be resolved without a contextual type
            navBar.buttonAppearance = [.tintColor:navBarColor] 
            navBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor : ContrastColorOf(navBarColor, returnFlat: true)]
            searchBar.barTintColor = navBarColor
        }
    }
}
I'm getting an error on navBar.buttonAppearance line. It says that Reference to member tintColor cannot be resolved without a contextual type.
 
    