Learn Courses My Dashboard

Error Regarding Navigation Bar Customization

I’ve just got a problem while changing the colour of navigation bar to custom colour and the problem is that the colour is not getting changed whether I do it programmatically or from Interface(StoryBoard)
I’ve searched for this problem on google , only one solution I found for this , I applied this solution but, no results.
App runs fine but with no change in colour , however at console following error shows up:
[Assert] UINavigationBar decoded as unlocked for UINavigationController, or navigationBar delegate set up incorrectly. Inconsistent configuration may cause problems. navigationController=<UINavigationController: 0x116815200>, navigationBar=<UINavigationBar: 0x115d07d00; frame = (0 0; 0 50); opaque = NO; autoresize = W; tintColor = UIExtendedGrayColorSpace 1 1; layer = <CALayer: 0x283fcfe40>> delegate=0x116815200

Here is the picture of what I’ve done at storyboard to get my task done.

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        self.navigationController?.navigationBar.isTranslucent = true
        self.navigationController?.navigationBar.barTintColor = UIColor.purple
        
    }


}

This is the code , which as I said I also tried programmatically.

So please help me getting it fix.