This answer found here https://stackoverflow.com/a/6797133/563381 but just incase here it is in Swift.
func resetDefaults() {
let defaults = UserDefaults.standard
let dictionary = defaults.dictionaryRepresentation()
dictionary.keys.forEach { key in
defaults.removeObject(forKey: key)
}
}