Skip to main content
Version: 4.1

RecipeDetailHeader

The Header is the first customizable component on the RecipeDetail at the very top of the page; to create your own recipe detail header you create a class that implements RecipeDetailsHeaderProtocol

import SwiftUI
import MealziOSSDK

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

with

public struct RecipeDetailsHeaderParameters {
/// The picture URL of the recipe
public let mediaURL: String?
/// The recipe title
public let title: String
/// The difficulty of the recipe (Easy, Medium, Difficult)
public let difficulty: Int
/// Time to prepare, cook, & rest
public let totalTime: String
/// Time to prepare
public let preparationTime: String
/// Time to cook
public let cookingTime: String
/// Time to let the meal sit after being cooked
public let restingTime: String
/// If the retailer allows the Mealz Like feature
public let isLikeEnabled: Bool
/// Recipe Id of the recipe
public let recipeId: String
/// Guest count set by the recipe
public let recipeGuests: Int
/// Guest count set by the user
public let currentGuests: Int
/// Boolean if the guest count is updating
public let guestUpdating: Bool
/// If this Recipe is being used from our Mealz Meal Planner feature
public let isForMealPlanner: Bool
/// Tags for the recipe (equipment, time, etc)
public let tags: [RecipeDetailTags]
/// Closure to close Page
public let onRecipeDetailsClosed: () -> Void
/// Closure to update the guest count
public let onUpdateGuests: (Int) -> Void