//bytes转Int
func lyz_getInt(data: Data) -> Int {
var num: Int = 0
for item in data {
let sub = Int(String(item))
num += sub ?? 0
}
return num
}
//bytes转Int
func lyz_getInt(data: Data) -> Int {
var num: Int = 0
for item in data {
let sub = Int(String(item))
num += sub ?? 0
}
return num
}
本文标题:Swift Data转Int
本文链接:https://www.haomeiwen.com/subject/rtqcyctx.html
网友评论