Minor tweaks
This commit is contained in:
parent
93fbdf7f09
commit
d328da99d5
|
@ -1,4 +1,4 @@
|
||||||
// swift-tools-version:5.2
|
// swift-tools-version:5.3
|
||||||
import PackageDescription
|
import PackageDescription
|
||||||
|
|
||||||
let package = Package(
|
let package = Package(
|
||||||
|
|
|
@ -140,6 +140,7 @@ extension UserDefaults {
|
||||||
- Note: This only removes user-defined entries. System-defined entries will remain.
|
- Note: This only removes user-defined entries. System-defined entries will remain.
|
||||||
*/
|
*/
|
||||||
public func removeAll() {
|
public func removeAll() {
|
||||||
|
// We're not using `.removePersistentDomain(forName:)` as it requires knowing the suite name and also because it doesn't emit change events for each key, but rather just `UserDefaults.didChangeNotification`, which we don't subscribe to.
|
||||||
for key in dictionaryRepresentation().keys {
|
for key in dictionaryRepresentation().keys {
|
||||||
removeObject(forKey: key)
|
removeObject(forKey: key)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue