Skip to main content
Version: 5.3

MyMealRecipeCard

MyMealRecipeCard

To create your own recipe card template you create a class that implements MyMealRecipeCardProtocol

import SwiftUI
import mealzcore
import MealziOSSDK

@available(iOS 14, *)
public struct MyCustomMyMealsRecipeCardView: MyMealRecipeCardProtocol {
public func content(params: MyMealRecipeCardParameters) -> some View {
// your imp here
}
}

with

public struct MyMealRecipeCardParameters {
/// The width & height of the recipe card
public let recipeCardDimensions: CGSize
/// The Recipe object of the meal
public let recipe: Recipe
/// The number of guests the recipe is designed for
public let numberOfGuests: Int
/// The price of the recipe
public let recipePrice: Double
/// The total number of products in the recipe
public let numberOfProductsInRecipe: Int
/// A boolean set to true when the user has begun to delete the recipe
public let isDeleting: Bool
/// A closure to delete the recipe, & all it's ingredients, from the basket
public let onDeleteRecipe: () -> Void
/// A closure that opens the RecipeDetails, passing in the recipeId
public let onShowRecipeDetails: (String) -> Void