Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix set badge tint color #615

Merged
merged 1 commit into from
Jul 16, 2023

Conversation

mlmorgan
Copy link
Contributor

Given a button badge is behind a modally presented view controller, when the tint color of the badge is set, then the badge color will be gray instead of the set color.

One way to fix this is to utilise tintColorDidChange instead of using a didSet for tintColor.

In these before and after examples, the badge tint color is being set to red in onTraitCollectionDidChange, which is being triggered by changing from dark to light mode (or vice versa):

Before:
https://user-images.githubusercontent.com/34710656/231182379-da87b0af-b8f8-4048-876f-8ef460340db1.mp4

After:
https://user-images.githubusercontent.com/34710656/231180867-72d0c09b-6c32-43d4-a256-450c3a7b745b.mp4

The downside to this fix is that the doc comment is removed. Another fix would be to use a new var instead of overriding tintColor, but that would create breaking changes.

@msaps
Copy link
Member

msaps commented Jul 16, 2023

Thanks for the contribution! 😄 and sorry for the delay 🚀

@msaps msaps merged commit 6480a22 into uias:main Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants