Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// CocktailResults.swift
// cocktailMaker
// Created by Claudia Contreras on 3/25/20.
// Copyright © 2020 thecoderpilot. All rights reserved.
import Foundation
struct CocktailResults: Codable {
let drinkName: String
let imageString: String
let ingredient1: String?
let ingredient2: String?
let ingredient3: String?
let ingredient4: String?
let ingredient5: String?
let ingredient6: String?
let ingredient7: String?
let ingredient8: String?
let ingredient9: String?
let ingredient10: String?
let measurement1: String?
let measurement2: String?
let measurement3: String?
let measurement4: String?
let measurement5: String?
let measurement6: String?
let measurement7: String?
let measurement8: String?
let measurement9: String?
let measurement10: String?
let instructions: String
enum CodingKeys: String, CodingKey {
case drinkName = "strDrink"
case imageString = "strDrinkThumb"
case ingredient1 = "strIngredient1"
case ingredient2 = "strIngredient2"
case ingredient3 = "strIngredient3"
case ingredient4 = "strIngredient4"
case ingredient5 = "strIngredient5"
case ingredient6 = "strIngredient6"
case ingredient7 = "strIngredient7"
case ingredient8 = "strIngredient8"
case ingredient9 = "strIngredient9"
case ingredient10 = "strIngredient10"
case measurement1 = "strMeasure1"
case measurement2 = "strMeasure2"
case measurement3 = "strMeasure3"
case measurement4 = "strMeasure4"
case measurement5 = "strMeasure5"
case measurement6 = "strMeasure6"
case measurement7 = "strMeasure7"
case measurement8 = "strMeasure8"
case measurement9 = "strMeasure9"
case measurement10 = "strMeasure10"
case instructions = "strInstructions"
struct DrinksResults: Codable {
let drinks: [CocktailResults]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment