swift + data to string code example Example: swift + data to string let str = String(decoding: data, as: UTF8.self)