我正在尝试使用 UserDefaults 附加和保存一系列字符串,但是我的代码正在替换数据而不是每次调用时都添加到数组中,我错过了什么?
if Plus == true
{
if typeOfMath != [""]
{
typeOfMath.append("Addition")
UserDefaults.standard.set(typeOfMath, forKey: "typeMath")
print ("\(typeOfMath)")
typeOfMath = [""]
}
}