uias / Tabman

™️ A powerful paging view controller with interactive indicator bars
https://uias.github.io/Tabman
MIT License
2.84k stars 235 forks source link

Fix issue that textColor of AnimateableLabel refers incorrect userInterfaceStyle #601

Closed Gyuni closed 2 years ago

Gyuni commented 2 years ago

https://user-images.githubusercontent.com/54972653/176935119-4877abfb-4748-4ef5-a61e-bd42dd00a79d.mov

When viewController overrides userInterfaceStyle as .light and contains AnimateableLabel as subview, it refers wrong traitCollection and shows wrong text color. In this case, AnimateableLabel refers .dark which is system setting of my simulator.

Therefore I modified two codes.

  1. UIColor.interpolate() returns dynamicColor on iOS 13 and higher
  2. AnimateableLabel's textColor refers AnimateableLabel's traitCollection

https://user-images.githubusercontent.com/54972653/176937630-298d6b44-deeb-4a95-b289-5e45e9cde3f4.mov

Now it works well.

Please consider it. Thank you 😄