Answers for "swift convert array to json"

-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 convert array to json"

Code answers related to "Javascript"

Browse Popular Code Answers by Language