xxxxxxxxxx
UserDefaults.standard.removeObject(forKey: "Key")
xxxxxxxxxx
let name = "John Doe"
UserDefaults.standard.set(name, forKey: "name")
xxxxxxxxxx
UserDefaults.standard.bool(forKey: "Key")
UserDefaults.standard.integer(forKey: "Key")
UserDefaults.standard.string(forKey: "Key")
xxxxxxxxxx
if let appDomain = Bundle.main.bundleIdentifier {
UserDefaults.standard.removePersistentDomain(forName: appDomain)
}