请告诉我如何通过nil
?因为后端不允许我发送空字符串,这就是我尝试发送nil
而不是空字符串的原因。
let params: [String : Any] = [
"billRefNumber": billPayment.billRefNumber!,
"custRefNo": nil,
"billAmount": billPayment.billAmount,
"charges": billPayment.sendCharges!
]
但是当我尝试通过nil
时发现了警告。
Nil与预期字典值类型“Any”swift
不兼容
如果我改变了,let params: [String: Any?] = [
答案 0 :(得分:3)
尝试
let params: [String: Any?]