更新时间:2023-11-29 08:12:58
您只需要有条件地将字典值强制转换为String,并在出现故障null
的情况下使用Nil合并运算符??
分配"0"
:
You just need to conditionally cast your dictionary value to String and use the Nil Coalescing Operator ??
to assign "0"
in case of failure null
:
let vote_status = Stream["vote_status"] as? String ?? "0"