I have a switch in the settings of my app that sets the visibility of the phone number prefix to true or false. I also have a custom color for numberPlaceholderColor and countryCodePlaceholderColor.
When the prefix is set to true/visible, the custom colors work fine for both the prefix and the number. When the prefix is set to false/hidden the custom colors are ignored for both. The code below runs in viewDidLoad. I’m running PhoneNumberKit 4.0.0 but this has been happening for quite a while. What am I doing wrong?
Has anybody else run into this?
func setTheThemeColors()
{
phone_Fld_Outlet.font = UIFont.systemFont(ofSize: gDefaultTextSize, weight: .regular)
// Set the placeholder text color
phone_Fld_Outlet.countryCodePlaceholderColor = Theme.current.placeHolderTextColor
phone_Fld_Outlet.numberPlaceholderColor = Theme.current.placeHolderTextColor
phone_Fld_Outlet.textColor = Theme.current.textColor
phone_Fld_Outlet.layer.borderColor = Theme.current.accentColor.cgColor
phone_Fld_Outlet.layer.backgroundColor = Theme.current.darkAccentColor.cgColor
phone_Fld_Outlet.layer.cornerRadius = 8
phone_Fld_Outlet.layer.borderWidth = 1.5
phone_Fld_Outlet.keyboardAppearance = Theme.current.keyBoardColor
// No phone number has been saved
if phone_Number.isEmpty
{
// Get prefix visibility from the database
phone_Fld_Outlet.withPrefix = ModelData.getThePrefix_Bool()
}
phone_Fld_Outlet.withExamplePlaceholder = true
}