I will explain my problem.
I realised an iphone application. When I was on simulator in Xcode all was good. But when I tried to test on real device stanger things happened. i have no iphone but I have an apple developer account. I put my build on Testflight and ask colleagues to test my app. The first one with an Iphone 11, test it and it worked like a charm. The second one with an Iphone 8 test it and there are many problems. Labels don't display. It's like the pages had just the title. On some pages, the background become black whereas it should be white. I don't understand. Both iphone are on ios 13 or older. I don't why. In simulator, iphone 8 and iphone 11 works.
Anyone have an idea why it happens and how we can correct that. Thanks a lot and have a nice day.
1 Method : if you want to use dark mode then you can change the colours as aspected in the dark mode like this
if #available(iOS 12.0, *)
{
if self.traitCollection.userInterfaceStyle == .dark
{
self.view.backgroundColor = .white
}
else
{
self.view.backgroundColor = .black
}
}
else
{
self.view.backgroundColor = .black
}
2. Method : If you want your colours as aspected in the light mode. Then you must add below line in the info.plist file
<key>UIUserInterfaceStyle</key>
<string>Light</string>