6.6 C
New York
Friday, April 11, 2025

goal c – Customized navigation merchandise seems pure white beginning iOS 18


The next problem happens with my setup beginning on iOS 18.

I’ve an UINavigationController to which I add my root view controller in my utility delegate class like this:

@implementation AppDelegate
{
  MyViewController* _myViewController;
}

- (BOOL)utility:(UIApplication*)utility didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
  _myViewController                                = [[MyViewController alloc] init];
  UINavigationController* mainNavigationController = [[UINavigationController alloc] initWithRootViewController:_myViewController];

  self.window                    = [[UIWindow alloc] init];
  self.window.backgroundColor    = [UIColor whiteColor];
  self.window.rootViewController = mainNavigationController;
  [self.window makeKeyAndVisible];

  return TRUE;
}

My root view controller will get its view from a Xib file. On this Xib file I’ve outlined not solely it is view but additionally a navigation bar with a custom-made navigation merchandise. I created an interface builder outlet with this custom-made navigation merchandise and return it if the system asks for it. The setup seems to be like this:

enter image description here

Ranging from iOS 18 this method appears to fail. First, the navigation merchandise is nil if the system asks for it for the primary few occasions and solely after a sure time the reference from the interface builder outlet is non nil which finally returns my custom-made navigation merchandise as I anticipated.

Doing so leaves the navigation bar in pure white and it appears my navigation merchandise is just not taken under consideration. Provided that I disguise and present the navigation bar it appears to set off the system to really choose up the custom-made navigation merchandise. The modified code seems to be like this:

enter image description here

Throughout my analysis I have never discovered any trace, that my method can be invalid or something associated that on iOS 18 this could give points. Ultimately my purpose is to have UI associated stuff for one view controller in the identical xib file, that’s the reason I positioned the navigation bar with the custom-made navigation merchandise within the view controllers xib file within the first place.

What do I miss that my custom-made navigation merchandise seems pure white if I do not set off a disguise/present of the navigation bar?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles