Not able to change background color of NavigationView - SwiftUI

Hi, I have been trying to change the default color of the NavigationView in the AppDelegate file and am unable to. Is it the code, or me? Using Xcode 13, Beta 1.

I got the code from hackingwithswift.com.

Here's the code:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

    // Change Color of Navigation Bar:
    let configuration = UINavigationBarAppearance()
    configuration.configureWithOpaqueBackground()
    configuration.backgroundColor = .systemPurple
    return true
}

Thank you. Dan Uff

Not able to change background color of NavigationView - SwiftUI
 
 
Q