func removeUserDefaults() {
let appDomain = Bundle.main.bundleIdentifier
UserDefaults.standard.removePersistentDomain(forName: appDomain!)
}
More than 5 years have passed since last update.
【Swift】UserDefaultsの全データを一括削除する方法
Last updated at Posted at 2016-12-28
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
9