From d328da99d516a8075500786cf435d4c549a9cf8d Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sun, 27 Sep 2020 13:01:31 +0200 Subject: [PATCH] Minor tweaks --- Package.swift | 2 +- Sources/Defaults/UserDefaults.swift | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index cf586e5..462b8ab 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 import PackageDescription let package = Package( diff --git a/Sources/Defaults/UserDefaults.swift b/Sources/Defaults/UserDefaults.swift index 147c928..b033317 100644 --- a/Sources/Defaults/UserDefaults.swift +++ b/Sources/Defaults/UserDefaults.swift @@ -140,6 +140,7 @@ extension UserDefaults { - Note: This only removes user-defined entries. System-defined entries will remain. */ 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 { removeObject(forKey: key) }