Make `Defaults` be an enum instead of a class
This commit is contained in:
parent
31b56ce018
commit
c34559cc58
|
@ -1,7 +1,7 @@
|
|||
// MIT License © Sindre Sorhus
|
||||
import Foundation
|
||||
|
||||
public final class Defaults {
|
||||
public enum Defaults {
|
||||
public class Keys {
|
||||
public typealias Key = Defaults.Key
|
||||
|
||||
|
@ -79,8 +79,6 @@ public final class Defaults {
|
|||
}
|
||||
}
|
||||
|
||||
fileprivate init() {}
|
||||
|
||||
/// Access a defaults value using a `Defaults.Key`.
|
||||
public static subscript<Value: Codable>(key: Key<Value>) -> Value {
|
||||
get { key.suite[key] }
|
||||
|
|
|
@ -65,7 +65,7 @@ extension Defaults {
|
|||
return try? NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(dataValue) as? Value
|
||||
}
|
||||
|
||||
final class BaseChange {
|
||||
struct BaseChange {
|
||||
let kind: NSKeyValueChange
|
||||
let indexes: IndexSet?
|
||||
let isPrior: Bool
|
||||
|
|
Loading…
Reference in New Issue