Answers for "how to fmake sure that data is save in userdefault"

2

save date to userdefaults swift

//save as Date
UserDefaults.standard.set(Date(), forKey: key)

//read
let date = UserDefaults.standard.object(forKey: key) as! Date
let df = DateFormatter()
df.dateFormat = "dd/MM/yyyy HH:mm"
print(df.string(from: date))
Posted by: Guest on April-03-2020
0

how to fmake sure that data is save in userdefault

UserDefaults.standard.removeObject(forKey: "name")
Posted by: Guest on December-03-2020
0

how to fmake sure that data is save in userdefault

UserDefaults.standard.removeObject(forKey: "Key")
Posted by: Guest on December-03-2020
0

how to fmake sure that data is save in userdefault

let name = "John Doe"
UserDefaults.standard.set(name, forKey: "name")
Posted by: Guest on December-03-2020
0

how to fmake sure that data is save in userdefault

if let appDomain = Bundle.main.bundleIdentifier {
UserDefaults.standard.removePersistentDomain(forName: appDomain)
 }
Posted by: Guest on December-03-2020
0

how to fmake sure that data is save in userdefault

UserDefaults.standard.bool(forKey: "Key")
 UserDefaults.standard.integer(forKey: "Key")
 UserDefaults.standard.string(forKey: "Key")
Posted by: Guest on December-03-2020

Code answers related to "how to fmake sure that data is save in userdefault"

Browse Popular Code Answers by Language