Created
February 17, 2020 06:36
-
-
Save dagronf/6ba845cf8fb97284540bef1c96ba3583 to your computer and use it in GitHub Desktop.
NSControl.StateValue extension for CustomStringConvertible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSControl.StateValue: CustomStringConvertible { | |
public var description: String { | |
switch self { | |
case .on: return NSLocalizedString("On", comment: "State for when a control is 'on'") | |
case .mixed: return NSLocalizedString("Mixed", comment: "State for when a control is neither on of off") | |
case .off: return NSLocalizedString("Off", comment: "State for when a control is 'off'") | |
default: fatalError("unimplemented state") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment