Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

dmTraitCollectionDidChange(_ previousTraitCollection: DMTraitCollection?) not called #104

Closed
lifution opened this issue May 13, 2021 · 2 comments

Comments

@lifution
Copy link

lifution commented May 13, 2021

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
Copy link
Member

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:

  1. Avoid subclassing these classes, but create a container view for the classes to handle dmTraitCollectionDidChange
  2. Override traitCollectionDidChange and apply the same logic on iOS 13

@lifution
Copy link
Author

@levinli303 Get it, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants