Answers for "swift json data to string"

0

swift + data to string

let str = String(decoding: data, as: UTF8.self)
Posted by: Guest on May-03-2020
-1

swift convert array to json

func json(from object:Any) -> String? {
    guard let data = try? JSONSerialization.data(withJSONObject: object, options: []) else {
        return nil
    }
    return String(data: data, encoding: String.Encoding.utf8)
}
Posted by: Guest on June-13-2020

Code answers related to "Swift"

Browse Popular Code Answers by Language