-
Notifications
You must be signed in to change notification settings - Fork 12
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
Added segment control to switch UI between light and dark mode #47
base: master
Are you sure you want to change the base?
Conversation
|
||
if #available(iOS 12.0, *) { | ||
// Start observing style change | ||
startObserving(&UserInterfaceStyleManager.shared) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to start observing?
|
||
// Observe user interface style change | ||
if #available(iOS 12.0, *) { | ||
startObserving(&UserInterfaceStyleManager.shared) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to start observing?
@available(iOS 12.0, *) | ||
internal class AppearanceInfoKnob : DroarKnob { | ||
|
||
private enum BuildInfoRow: Int { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this CaseIterable and remove "count"
BuildInfoRow.allCases().count
} | ||
|
||
func droarKnobNumberOfCells() -> Int { | ||
return BuildInfoRow.count.rawValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the enum count (not as a case)
We talked about this in person - but for visibility: I would suggest simulating the system color style by modifying the key window's style. This will change unspecified view styles to the new mode (dark or light) while probably(?) leaving the already set views as they are. Ex: if View A is light and View B is unspecified, setting the style in Droar to dark should result in View A being light and View B being dark. Ultimately this will be like switching your systems style, but from within Droar and it will only impact the current app session. |
No description provided.