`dmTraitCollectionDidChange(_ previousTraitCollection: DMTraitCollection?)` not called
lifution opened this issue · 2 comments
lifution commented
iOS 13 and newer, method dmTraitCollectionDidChange(_ previousTraitCollection: DMTraitCollection?)
not called after overrideTraitCollection
updated.
This problem appeared in UIImageView
and UILabel
.
FluentDarkModeKit version: 1.0.3
levinli303 commented
This is expected. The following classes are known to not call UIView's traitCollectionDidChange
thus dmTraitCollectionDidChange
cannot be bridged.
UIView subclasses: UIImageView, UILabel, UIDatePicker, UIPickerView
UIViewController subclass: UISplitViewController
My suggestion to fix it would be either:
- Avoid subclassing these classes, but create a container view for the classes to handle
dmTraitCollectionDidChange
- Override
traitCollectionDidChange
and apply the same logic on iOS 13
lifution commented
@levinli303 Get it, thanks.