iOS 13 Navigation Bar Prompt is Always Black - ios

I have read the other posts about the UINavigationBar's Prompt not following the color values of the actual Title. Most of the posts are from the iOS 11 era, and the solutions no longer work on iOS 13.
These are examples of previous posts that no longer have working solutions:
Can't change UINavigationBar prompt color
Change font of prompt in UINavigationController
iPhone: Possible to change the color of just the prompt of the UINavigationBar?
Has anyone else encountered this?

I would suggest the following:
Check that the device is not running in Dark Mode.
Verify that the background-color was not modified anywhere in the code.
Make sure that the style is set to default like in the screenshot below:

Related

Storyboard is not showing custom color hex code in XCode 12.0.1

After updating to the latest Xcode, into storyboard I am not able to see actual custom color hex code. It is showing a white(FFFFFF) color hex code all time.
Can someone please help me with this? Please check the below screenshot.
I have noticed this same problem since the latest XCode Version 12.0.1.
A workaround that works for me is to
Click on the custom color to bring up the color chooser.
The color chooser is the wrong color, but tap on any other color in the color chooser.
Tap Cmd+Z to undo the color change. Magically the original custom color is now selected in the color chooser.
Almost the same idea work around and quicker without needing to change the color (and then reverse):
Select your color (this will make the color picker appear) in the drop list.
Select again your color (with the picker still shown) in the drop list (not in the color picker window), it will update the picker to your color.
Apple has now fixed this issue in Xcode 12.5
Fixed an issue where the custom colors swatch in an inspector’s color
properties displayed an incorrectly offset focus indicator.
Reference: Apple Xcode 12.5 Release Notes

Bar button item tint colors with iOS bold text settings

I've received a screenshot from my app by an older lady who seems to have activated "Bold text" in her iPhone settings.
Since I've never really looked at that before and my app does not support dynamic text (which seems to not be related) I was surprised to see that in this mode the tint colors I gave my bar button items are being ignored and they'll always show in standard iOS Nav bar button blue, this line of code does not have an effect anymore:
myBarButtonItem.tintColor = myColor
In my case the color indicates their state so that's a dealbreaker.
I know that I could detect whether the user has activated this setting (as indicated in the answer here Possible to detect Bold Text setting in Settings > Accessibility? ) and indicate the state by using different icons...
But is there any way around this and keep my tint colors in bold text mode?
Try with appearance
UIBarButtonItem.appearance().tintColor = yourcolor

setTitleTextAttributes not working after view on screen. iOS 11

I've spent a whole day trying to change the colour of a UIBarButtonItem and now i'm thinking it is an iOS 11 bug unless someone can tell me it's by design.
I can change the colour of the text by using this code
[self.refreshButton setTitleTextAttributes:#{NSForegroundColorAttributeName: [UIColor orangeColor]} forState:UIControlStateNormal];
If I add the code to the viewWillAppear:animated function it works fine, however if you add it to viewDidAppear:animated it does not work.
It seems to work on the iOS 9 simulator, but not iOS 11.
Has something changed in this regard in iOS 11?
If all you want to do is change the title color of your UIBarButtonItem you can set the tintColor property instead of setTitleTextAttributes:. If you want all of your UIBarButtonItems to have the same title color you can set the tintColor of your tool/navigation bar.
I had the same issue on iOS11 but needed to set the font by setTitleTextAttributes. Unfortunately this does also not work by appearance. The only solution I found was to create new BarButtonItems as copy of the old ones and then set them as navigationItem.rightBarButtonItems.
For reference for other users having the same issue.
This Stack Overflow answer may explain why the method doesn't work.
An improper setting of UIControlState() may be the problem.

iOS - Is it possible to change statusBarStyle to a custom colour?

I'm a beginner with iOS app development and want to customize the Status Bar colour. I have set my scene to a dark background and I want to battery and time in the Status Bar to match the colour.
At the moment I have added
var navigationBarAppearace = UINavigationBar.appearance()
UIApplication.shared.statusBarStyle = .lightContent
in AppDelegate.swift
Is there a way to add a custom hex colour for the text, not background?
I'm afraid there isn't without accessing private API's, which will get your app declined from apple review.
It's best to just find a way to make your app design work with the given, white or black status bar style.
The one thing you could do is create your own status bar that imitated the UIStatusBar, with your own labels and icons, but that would be a reasonable amount of hassle.

Xcode: reverting back to default color in iOS

I am trying to find a way to revert back to the system default color programmatically for iOS components using code. The only other way would be to use 2 controls - 1 set to either color and switch them.
Any info is appreciated. Thanks.
I tried below code in order to change the background of a button to its default color and it worked for me
submitBtn.backgroundColor = UIColor.clear

Resources