This file contains 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 UserDefaults { | |
func color(forKey defaultName: String) -> UIColor? { | |
var color: UIColor? | |
if let colorData = data(forKey: defaultName) { | |
color = NSKeyedUnarchiver.unarchiveObject(with: colorData) as? UIColor | |
} | |
return color | |
} | |
func set(_ value: UIColor?, forKey defaultName: String) { |