Skip to main content
Version: 5.5

RecipeDetailUnavailableIngredientsToggleButton

UnavailableIngredientsToggleButton

To create your own toggle button that programmatically shows the unavailable ingredients, you create a class that implements BaseButtonProtocol.

import SwiftUI
import MealziOSSDK

@available(iOS 14, *)
public struct MyCustomButtonView: BaseButtonProtocol {
public func content(params: BaseButtonParameters) -> some View {
// your implementation here
}
}

with

public struct BaseButtonParameters {
/// Text that displays on the button
public let buttonText: String
/// Boolean on whether or not the button has been pressed yet
public let buttonPressed: Bool
/// A closure that executes the function passed in
public let onButtonAction: () -> Void