I had the same message in the console. In my case, I was configuring the navigationBar to prefer large titles. I was doing this in my main ViewController, but when I moved that logic to the application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool method of my AppDelegate, the message in the console disappeared.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:
[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
UINavigationBar.appearance().prefersLargeTitles = true
return true
}
By configuring prefersLargeTitles in the AppDelegate, you are setting this preference before any view controllers are created and initialized. This can help avoid conflicts or unexpected behaviors that may arise when changing the navigation bar settings after view controllers are already in use or presented on the screen.
Also, keep in mind that prefersLargeTitles was introduced in iOS 11, so earlier versions will show an error.