Skip to content

Instantly share code, notes, and snippets.

@dimohamdy
Created April 4, 2019 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimohamdy/b82bd09d3189d0c4dccd7dd56be25c50 to your computer and use it in GitHub Desktop.
Save dimohamdy/b82bd09d3189d0c4dccd7dd56be25c50 to your computer and use it in GitHub Desktop.
let jsonString = """
{
"id": 1,
"name": "yearly.plan",
"display_name": "الباقة اليومية",
"payment_method_key": "1",
"number_of_days": "35",
"payment_method_id": 3
}
"""
let jsonData = jsonString.data(using: .utf8)!
let user = try! JSONDecoder().decode(Plan.self, from: jsonData)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment