Skip to main content
Version: 4.1

RecipeDetailsNotInBasketProduct

NotInBasketProduct

To create your own recipe detail not in basket product template you create a class that implements NotInBasketProductProtocol

import SwiftUI
import MealziOSSDK
import mealzcore

@available(iOS 14, *)
public struct MyCustomRecipeDetailsNotInBasketProductView: NotInBasketProductProtocol {
public func content(params: NotInBasketProductParameters) -> some View {
// Your custom design here
}
}

with

public struct NotInBasketProductParameters {
/// The name of the ingredient in the recipe
public let ingredientName: String
/// The quantity of the ingredient that the recipe requires
public let ingredientQuantity: String
/// The unit of the ingredient that the recipe use (ex: g, kg)
public let ingredientUnit: String
/// The number of guests that the user has set
public let guestsCount: Int
/// The number of guests that the default recipe has set
public let defaultRecipeGuest: Int
/// The CTA to add a product to the basket if it is available (already at home or deleted products)
public var onAddToBasket: (() -> Void)?