获取某一对象可能为空时
if let array = UserDefaults.standard.object(forKey: History_LIST) as? [String]
{
}
可选值 String? 取值时候要加 !
image.png
判断字符串有是否有值
if text.count > 0{
}
获取某一对象可能为空时
if let array = UserDefaults.standard.object(forKey: History_LIST) as? [String]
{
}
可选值 String? 取值时候要加 !
判断字符串有是否有值
if text.count > 0{
}