1
0
mirror of https://github.com/metabolist/metatext synced 2024-12-18 12:28:35 +01:00
metatext-app-ios-iphone-ipad/ServiceLayer/Sources/ServiceLayerMocks/MockUserDefaults.swift
Justin Mazzocchi 2ca0dfe251
wip
2020-08-31 11:57:02 -07:00

22 lines
560 B
Swift

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