Last active
July 12, 2017 17:46
-
-
Save Ravi61/972a324becc5f63bcb6ac1efeed0cdcb to your computer and use it in GitHub Desktop.
Encoding Code for
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
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