conert data to string swift

Swift
let str = String(decoding: data, as: UTF8.self)
Source

Also in Swift: