Created
December 20, 2022 12:44
-
-
Save AashirMubeeb/340e35686b83aef8dce2d41bb7d04697 to your computer and use it in GitHub Desktop.
Read Json file form Assets file in xcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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