Skip to main content
Version: 4.1

SearchBar

To create your own search bar that returns products, you create a class that implements BaseSearchComponent.

import SwiftUI
import MealziOSSDK

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

with

public struct SearchParameters {
/// Text result from the user input, bindable
public let searchText: Binding<String>
/// A closure that executes the function passed in
public let onApply: () -> Void