Lay out and discuss the Flow and the Objects and Methods that control it.
File: (~/Controllers/SearchVCs/SearchViewController
)
- Loads SearchView (
~/Views/SearchViews/SearchView
) - UITextField Recieves Input
- SearchButtonTapped
-- If UITextField is Empty, display error message
-- Else Display Results in
RecipeListCollectionView
Displays a Collection List of Results (loadRecipes(for: searchedRecipe
)
-
CollectionViewCells (
~/Views/Elements/RecipeCell
) -- didSelectItemAt loads RecipeViewController (~/Controllers/RecipeVCs/RecipeViewController
)Note: Need default screen if there are no results
- Methods called on
viewWillAppear
:loadRecipeByID(for: recipeID)
(local method)getInstructions(for: recipeID)
(local method)
- Loads RecipeView (
~/Views/RecipeViews/RecipeView
)
- Loads GeneralModal (
~/Views/Modals/GeneralModal
) - Displays Basic Info, i.e. Time To Make, # of Servings, etc.
- Data populated from method
generateGeneralInfo(for selectedRecipe: Recipe)
File: (~/Controllers/VCMethods/DataGeneration/GeneralInfo
) Extension of RecipeViewController
- Loads IngredientsModal (
~/Views/Modals/IngredientsModal
) - Displays Basic Info, i.e. Time To Make, # of Servings, etc.
- Data populated from method
generateGeneralInfo(for selectedRecipe: Recipe)
(~/Controllers/VCMethods/DataGeneration/GeneralInfo
) Extension of RecipeViewController
- Loads IngredientsModal (
~/Views/Modals/Summary/Modal
) - Displays all Summary of Recipe from API
- Data populated from method
generateSummary(for selectedRecipe: Recipe)
(~/Controllers/VCMethods/DataGeneration/GenerateSummary
) Extension of RecipeViewController
- Loads SummaryModal (
~/Views/Modals/MacrosModal
) - Displays Nutritional Information, i.e. calories, iron, vitamins, etc
- Data populated from method
generateDietsInfo(for selectedRecipe: Recipe)
(~/Controllers/VCMethods/DataGeneration/GenerateMacros
) Extension of RecipeViewController
- Loads SummaryModal (~/Views/Modals/DietsModal)
- Displays Diets Information, i.e. vegan, gluten free, keto, etc
- Data populated from method
generateMacrosModel(for selectedRecipe: Recipe)
(~/Controllers/VCMethods/DataGeneration/GenerateDietsInfo
) Extension of RecipeViewController
- Loads StagedCardContainerViewController (
~/Controllers/StagedCards/CardContainerViewController
) - Calls Method
buildCards(ingredients: [String], instructionsDictionary: [Int: String], ingredientDictionary: [Int: [String]]) -> [Card]
(~/Controllers/VCMethods/CardRelated/CardBuilder
)