SearchBar

public struct SearchBar<S> : View where S : StringProtocol

SearchBar SwiftUI wrapper for rendering a TextField, magnifer icon and clear button while editing

  • Constructor

    Declaration

    Swift

    public init(_ placeholder: S, text: Binding<String>, _ onCommit: @escaping () -> Void)

    Parameters

    placeholder

    Placeholder. Should conform to StringProtocol

    text

    Binding

    onCommit

    Handler called when user presses return