I'm implementing the dark mode for iOS. The problem occurs with the images:
Unfortunately the images are not being redrawn when overriding the environment interface style in xcode.
I've tried catching the traitCollectionDidChange method in my viewController and it is properly called. I could set the new image (origImage_dark), but shouldn't it be automatic? That's what the asset settings are made for. I'm using the .alwaysOriginal rendering of the image.
Running the app with dynamic resolve of the image helped:
let image = UIImage(named: "someImage")
let asset = image?.imageAsset
let resolvedImage = asset?.image(with: traitCollection)
After this, reverting back to the original way of setting the images seemed to work. Xcode, thanks a lot!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With