As Pranav said, the problem here is the background color for representing the navigation controller, however changing this from the child view controller is not an ideal way to do this.
Instead, it is better to use a subclass of UINavigationController, and viewDidLoad() to
override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .white }
Then just use your own subclass, not the standard UINavigationController. Thus, you only need this code in one place.
source share