shouldAutomaticallyForwardAppearanceMethods returns NO by default in UITabBarController, but documentation states YES

Hi all,

I’ve been facing a behavior issue with shouldAutomaticallyForwardAppearanceMethods in UITabBarController. According to Apple’s documentation, this property should default to YES, which means that the appearance lifecycle methods (like viewWillAppear and viewDidAppear) should be automatically forwarded to child view controllers.

However, in my current development environment, I’ve noticed that shouldAutomaticallyForwardAppearanceMethods returns NO by default in UITabBarController, and this is causing some issues with lifecycle management in my app. I even tested this behavior in several projects, both in Swift and Objective-C, and the result is consistent.

Here are some details about my setup:

I’m using Xcode 16.0 with iOS 16.4 Simulator. I’ve tested the behavior in both a new UIKit project and a simple SwiftUI project that uses a UITabBarController. Even with a clean new project, the value of shouldAutomaticallyForwardAppearanceMethods is NO by default. This behavior contradicts the official documentation, which states that it should be YES by default. Could someone clarify if this is expected behavior in newer versions of iOS or if there is a known issue regarding this?

Any help or clarification would be greatly appreciated!

Thanks in advance!

Your pointing to UIViewController documentation, for which that is accurate. UITabBarController, being a subclass, may in turn change the value for its own purposes, and because that would be an implementation detail of that class, is not necessarily documented.

Bottom line is this is legal and expected. Since UITabBarController (like other UIViewController subclasses provided by UIKit) need not support or expect arbitrary child view controllers be added to it, how it manages child view controllers (including how it forwards appearance methods) is not something that you should be relying upon and may in turn change in the future.

shouldAutomaticallyForwardAppearanceMethods returns NO by default in UITabBarController, but documentation states YES
 
 
Q