Skip to content

Instantly share code, notes, and snippets.

@AashirMubeeb
Created December 20, 2022 12:44
Show Gist options
  • Save AashirMubeeb/340e35686b83aef8dce2d41bb7d04697 to your computer and use it in GitHub Desktop.
Save AashirMubeeb/340e35686b83aef8dce2d41bb7d04697 to your computer and use it in GitHub Desktop.
Read Json file form Assets file in xcode
if let assesFile = NSDataAsset.init(name: "fileName") {
let data = assesFile.data
do {
let model = try JSONDecoder().decode(Model.self, from: data)
self.processReadJsonData(model: model)
return true
}catch {
print(error.localizedDescription)
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment