data 转 jSon
do {
let stringDic = try JSONSerialization.jsonObject(with: jsonData, options: .allowFragments) as? [String : Any]
print(stringDic)
} catch let error {
print(error)
}
data 转 jSon
do {
let stringDic = try JSONSerialization.jsonObject(with: jsonData, options: .allowFragments) as? [String : Any]
print(stringDic)
} catch let error {
print(error)
}
本文标题:swift-类型转换
本文链接:https://www.haomeiwen.com/subject/txojjftx.html
网友评论