metatext/Development Assets/FakeUserDefaults.swift
Justin Mazzocchi 827c3cfc77
Refactoring
2020-08-02 17:40:25 -07:00

21 lines
539 B
Swift

// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
class FakeUserDefaults: UserDefaults {
convenience init() {
self.init(suiteName: Self.suiteName)!
}
override init?(suiteName suitename: String?) {
guard let suitename = suitename else { return nil }
UserDefaults().removePersistentDomain(forName: suitename)
super.init(suiteName: suitename)
}
}
private extension FakeUserDefaults {
private static let suiteName = "com.metatext.metabolist.fake-user-defaults"
}