Its important to note that this same app did not have this issue in iOS 17.
Ever since iOS 18 I have noticed that when application written in SwiftUI uses Label
with the default color (which auto changes between light and dark appearance), from time to time when resuming an application that has been in the background, the color of those labels (only the Label
elements) switches from the opposite to the correct one. Here is an example:
Steps to reproduce
- Phone is in dark appearance
- Open app
- Labels text color is white and labels background is black
- Go to home so that app is on background
- Wait random time (does not happen all the time), some times 1 min some times 10
- Reopen the application.
- During the opening transition the Label text color was changed while the app was in suspended mode to the light appearance variant (black)
- Once the app opening transition finishes the Label text color switches back to the correct color for dark appearance (white)
Same issue happens if you start from light appearance. I cannot reproduce this on Xcode simulators, I have tried to force memory warning to check if that has anything to do with it but that also does not cause the issue to appear on simulators. For now I can only reproduce this on real device.
Screenshots
Here is screenshots of the above example:
During transition
After transition