Skip to content

Instantly share code, notes, and snippets.

@giovani-pereira-ifood
Created March 26, 2021 19:59
Show Gist options
  • Save giovani-pereira-ifood/7e74fdb31a3c2c99c74c771691f039aa to your computer and use it in GitHub Desktop.
Save giovani-pereira-ifood/7e74fdb31a3c2c99c74c771691f039aa to your computer and use it in GitHub Desktop.
func record(file: [IconData]) throws {
// Create the JSON
let data = try JSONEncoder().encode(file)
let json = try convertToFormattedJSON(data: data)
// Get the file path
let referenceFileURL = try getReferenceFilePath()
// Write file
try json.write(to: referenceFileURL, atomically: false, encoding: .utf8)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment