标签: swift
如何在Swift 3中将[UInt8]转换为[UInt32]?
let u8: [UInt8] = [0x02, 0x02, 0x02]
答案 0 :(得分:4)
试试这个
let u8: [UInt8] = [0x02, 0x02, 0x02] let u32: [UInt32] = u8.map { UInt32($0) } print("u32: \(u32)")