Skip to content

Instantly share code, notes, and snippets.

@Ravi61
Last active July 12, 2017 17:46
Show Gist options
  • Save Ravi61/972a324becc5f63bcb6ac1efeed0cdcb to your computer and use it in GitHub Desktop.
Save Ravi61/972a324becc5f63bcb6ac1efeed0cdcb to your computer and use it in GitHub Desktop.
Encoding Code for
let encoder = JSONEncoder()
do {
let data = try encoder.encode(BattleShip)
print(String(data: data, encoding: .utf8)!)
} catch {
print("error in converting the model")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment