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

Refactoring #14

Merged
merged 4 commits into from
Feb 15, 2021
Merged

Refactoring #14

merged 4 commits into from
Feb 15, 2021

Conversation

dkk
Copy link
Contributor

@dkk dkk commented Feb 14, 2021

Refactoring of the Color Extension

@costachung
Copy link
Owner

costachung commented Feb 15, 2021

There is still an issue on MacOS that the view will not redraw itself automatically when user changes the appearance in system preferences.
#13

It works ok on iOS that we use init(dynamicProvider: @escaping (UITraitCollection) -> UIColor) to create the UIColor. When the system appearance changes. The view that use the color will redraw itself.

With the current implementation for MacOS, the automatic-colorScheme-update only works on creation. it won't work on change. However, it will work on change if we put @Environment(.colorScheme) var colorScheme: ColorScheme in the view.

Copy link
Owner

@costachung costachung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great.

@costachung costachung merged commit f747e18 into costachung:master Feb 15, 2021
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.

None yet

2 participants