Tag: codable

Reading and Writing to a JSON in Swift

Lets consider you have a sample JSON as shown belowhttps://gist.github.com/kmdarshan/cfa6a940268f7091faf886ed63b3b559 You can make use of Codable Library (https://developer.apple.com/documentation/swift/codable) in Swift to read and write data from a JSON. Firstly you need to map your data from the JSON onto a Struct as shown below. Once you have done that, its easy to read it using

Continue Reading →