Skip to main content
Version: 5.3

RecipeDetailHeader

The Header is a customizable component on the RecipeDetail that includes the photo & guest counter; 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
@available(*, deprecated, message: "Moved to RecipeDetailsTags")
/// The difficulty of the recipe (Easy, Medium, Difficult)
public let difficulty: Int
@available(*, deprecated, message: "Moved to RecipeDetailsTags")
/// Time to prepare, cook, & rest
public let totalTime: String
@available(*, deprecated, message: "Moved to RecipeDetailsTags")
/// Time to prepare
public let preparationTime: String
@available(*, deprecated, message: "Moved to RecipeDetailsTags")
/// Time to cook
public let cookingTime: String
@available(*, deprecated, message: "Moved to RecipeDetailsTags")
/// Time to let the meal sit after being cooked
public let restingTime: String
@available(*, deprecated, message: "Like Button moved to RecipeDetailsFloatingNavigationProtocol")
/// 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
@available(*, deprecated, message: "Moved to RecipeDetailsTags")
/// Tags for the recipe (equipment, time, etc)
public let tags: [RecipeDetailTags]
@available(*, deprecated, message: "Close Recipe Details Button moved to RecipeDetailsFloatingNavigationProtocol")
/// Closure to close Page
public let onRecipeDetailsClosed: () -> Void
/// Closure to update the guest count
public let onUpdateGuests: (Int) -> Void