1
0
mirror of https://github.com/metabolist/metatext synced 2024-12-14 18:35:37 +01:00
metatext-app-ios-iphone-ipad/Development Assets/FakeUserDefaults.swift

22 lines
539 B
Swift
Raw Normal View History

2020-08-03 00:23:01 +02:00
// 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"
}