[kit] Implement the notification infrastructure

This commit is contained in:
Eryn Wells 2017-08-16 21:12:00 -07:00
parent 0aa82ce59e
commit 587e616d76
3 changed files with 55 additions and 16 deletions

View file

@ -52,7 +52,11 @@ extension UserDefaults {
return Float4(values[0], values[1], values[2], values[3])
}
func set(value: Float4, forKey key: String) {
set([Float](float4: value), forKey: key)
func set(_ value: Float4?, forKey key: String) {
if let value = value {
set([Float](float4: value), forKey: key)
} else {
set(nil as Any?, forKey: key)
}
}
}