Save data in phone
Saving data permanently in the phone:
It will be stored in the root directory under info.plist.
To access object, check if it is empty first. If it is give it a value:
if UserDefaults.standard.string(forKey: "NameOfTheItem") == nil
{
UserDefaults.standard.set("firstValue", forKey: "NameOfTheItem")
}
It will be stored in the root directory under info.plist.
To access object, check if it is empty first. If it is give it a value:
if UserDefaults.standard.string(forKey: "NameOfTheItem") == nil
{
UserDefaults.standard.set("firstValue", forKey: "NameOfTheItem")
}
Comments
Post a Comment