SearchableListView
public struct SearchableListView<CancelActionView, DoneActionView> where CancelActionView : View, DoneActionView : View
extension SearchableListView: View
Undocumented
-
Undocumented
Declaration
Swift
public init( @ViewBuilder cancelAction: () -> CancelActionView, @ViewBuilder doneAction: () -> DoneActionView ) -
Declaration
Swift
@MainActor public var body: some View { get }
-
Create a searchable list view which supports both single-level and multi-level picker with the ability to select one or multiple items.
Declaration
Swift
init<Data: RandomAccessCollection, ID: Hashable>( data: Data, id: KeyPath<Data.Element, ID>, children: KeyPath<Data.Element, Data?>?, selection: Binding<Set<ID>>?, allowsMultipleSelection: Bool = false, searchFilter: ((Data.Element, String) -> Bool)?, @ViewBuilder rowContent: @escaping (Data.Element) -> some View, rowBackground: ((Data.Element) -> some View)? = nil )Parameters
dataThe data for constructing the list picker.
idThe key path to the data model’s unique identifier.
childrenThe key path to the optional property of a data element whose value indicates the children of that element.
selectionA binding to a set which stores the selected items.
allowsMultipleSelectionA boolean value to indicate to allow multiple selections or not.
searchFilterThe closure to filter the
datain searching process. Request a boolean by the element and the filter key.rowContentThe view builder which returns the content of each row in the list picker.
rowBackgroundThe background for the list row.
-
Create a searchable list view which supports both single-level and multi-level picker with the ability to select one or multiple items.
Declaration
Swift
init(data: [String], selection: Binding<Set<String>>?, allowsMultipleSelection: Bool = false, searchFilter: ((String, String) -> Bool)? = nil)Parameters
dataThe data for constructing the list picker.
selectionA binding to a set which stores the selected items.
allowsMultipleSelectionA boolean value to indicate to allow multiple selections or not.
searchFilterThe closure to filter the
datain searching process. Request a boolean by the element and the filter key. -
Create a searchable list view which supports both single-level and multi-level picker with the ability to select one or multiple items.
Declaration
Swift
init(data: [String], selection: Binding<Set<String>>?, allowsMultipleSelection: Bool = false, searchFilter: ((String, String) -> Bool)?, rowBackground: ((String) -> some View)? = nil)Parameters
dataThe data for constructing the list picker.
selectionA binding to a set which stores the selected items.
allowsMultipleSelectionA boolean value to indicate to allow multiple selections or not.
searchFilterThe closure to filter the
datain searching process. Request a boolean by the element and the filter key.rowBackgroundThe background for the list row.
-
Create a searchable list view which supports both single-level and multi-level picker with the ability to select one or multiple items.
Declaration
Swift
init<Data: RandomAccessCollection, ID: Hashable>( data: Data, id: KeyPath<Data.Element, ID>, children: KeyPath<Data.Element, Data?>?, selection: Binding<Set<ID>>?, allowsMultipleSelection: Bool = false, searchFilter: ((Data.Element, String) -> Bool)?, @ViewBuilder rowContent: @escaping (Data.Element) -> some View )Parameters
dataThe data for constructing the list picker.
idThe key path to the data model’s unique identifier.
childrenThe key path to the optional property of a data element whose value indicates the children of that element.
selectionA binding to a set which stores the selected items.
allowsMultipleSelectionA boolean value to indicate to allow multiple selections or not.
searchFilterThe closure to filter the
datain searching process. Request a boolean by the element and the filter key.rowContentThe view builder which returns the content of each row in the list picker.
-
init(data:id: children: selection: allowsMultipleSelection: searchFilter: rowContent: rowBackground: cancelAction: doneAction: ) Create a searchable list view which supports both single-level and multi-level picker with the ability to select one or multiple items.
Declaration
Swift
init<Data: RandomAccessCollection, ID: Hashable>( data: Data, id: KeyPath<Data.Element, ID>, children: KeyPath<Data.Element, Data?>?, selection: Binding<Set<ID>>?, allowsMultipleSelection: Bool = false, searchFilter: ((Data.Element, String) -> Bool)?, @ViewBuilder rowContent: @escaping (Data.Element) -> some View, rowBackground: ((Data.Element) -> some View)? = nil, cancelAction: _Action? = _Action(model: _CancelActionDefault()), doneAction: _Action? = _Action(model: _DoneActionDefault()) )Parameters
dataThe data for constructing the list picker.
idThe key path to the data model’s unique identifier.
childrenThe key path to the optional property of a data element whose value indicates the children of that element.
selectionA binding to a set which stores the selected items.
allowsMultipleSelectionA boolean value to indicate to allow multiple selections or not.
searchFilterThe closure to filter the
datain searching process. Request a boolean by the element and the filter key.rowContentThe view builder which returns the content of each row in the list picker.
rowBackgroundThe background for the list row.
cancelActionCustomzation searchable list cancel action.
doneActionCustomzation searchable list done action.
-
init(data:id: children: selection: isTopLevel: allowsMultipleSelection: searchFilter: rowContent: rowBackground: ) Undocumented
Declaration
Swift
init<Data: RandomAccessCollection, ID: Hashable>( data: Data, id: KeyPath<Data.Element, ID>, children: KeyPath<Data.Element, Data?>?, selection: Binding<Set<ID>>?, isTopLevel: Bool, allowsMultipleSelection: Bool = false, searchFilter: ((Data.Element, String) -> Bool)?, @ViewBuilder rowContent: @escaping (Data.Element) -> some View, rowBackground: ((Data.Element) -> some View)? = nil ) -
Undocumented
Declaration
Swift
public init(model: SearchableListViewModel)
-
Undocumented
Declaration
Swift
public init( @ViewBuilder doneAction: () -> DoneActionView )
-
Undocumented
Declaration
Swift
public init( @ViewBuilder cancelAction: () -> CancelActionView )