I.e., my app sets some standard default values at the beginning. Then those values may get overridden by the user. And when the user messes things up, I want to set those se
Swift 3+
UserDefaults.standard.removeObject(forKey: "KEY")
Obj-C
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"KEY"];
[[NSUserDefaults standardUserDefaults] synchronize];
NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier];
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];
Swift 3:
if let bundle = Bundle.main.bundleIdentifier {
UserDefaults.standard.removePersistentDomain(forName: bundle)
}
Try removeObjectForKey -- that should give you the ability to remove a preference.