Swift API for fetching recipes online using Recipe Puppy http://www.recipepuppy.com.
- Include the files from the SwiftyRecipes folder in your project
- Use the SRRecipeClient to fetch recipes online
- Store the recipes as SRRecipe objects
Below are some simple examples of using the API.
let query = "italian"
var recipes: [SRRecipe]?
SRPuppyClient.sharedClient().fetchRecipesWithQuery(query, completionHandler: {
result, _ in
recipes = result
})
print(recipes)
let ingredients = ["tomato", "cucumber", "onion"]
var recipes: [SRRecipe]?
SRPuppyClient.sharedClient().fetchRecipesWithIngredients(ingredients, completionHandler: {
result, _ in
recipes = result
})
print(recipes)