Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 adidSet
fortintColor
.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 overridingtintColor
, but that would create breaking changes.