Skip to main content
Version: 5.3

Ingredients

This template allows you to customize the Ingredients section of the Preferences page.

import SwiftUI
import mealzcore
import MealziOSSDK

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

Params

public struct PreferencesIngredientsParameters {
/// The differerent types of ingredient (like Eggs)
public let ingredientsTag: [CheckableTag]
/// The geometry so that the users can tap a tag & apply it
public let geometry: GeometryProxy
/// Whether or not all options are available to be seen
@Binding public var isExpanded: Bool
/// A closure that selects this ingredient option. Multiple options can be selected at the same time
public let onTogglePreference: (String) -> Void
/// A closure that opens up the PreferencesSearch page where users can add more blacklisted ingredients
public let onGoToSearch: () -> Void