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
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
data
The data for constructing the list picker.
id
The key path to the data model’s unique identifier.
children
The key path to the optional property of a data element whose value indicates the children of that element.
selection
A binding to a set which stores the selected items.
allowsMultipleSelection
A boolean value to indicate to allow multiple selections or not.
searchFilter
The closure to filter the
data
in searching process. Request a boolean by the element and the filter key.rowContent
The view builder which returns the content of each row in the list picker.
rowBackground
The 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
data
The data for constructing the list picker.
selection
A binding to a set which stores the selected items.
allowsMultipleSelection
A boolean value to indicate to allow multiple selections or not.
searchFilter
The closure to filter the
data
in 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
data
The data for constructing the list picker.
selection
A binding to a set which stores the selected items.
allowsMultipleSelection
A boolean value to indicate to allow multiple selections or not.
searchFilter
The closure to filter the
data
in searching process. Request a boolean by the element and the filter key.rowBackground
The 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
data
The data for constructing the list picker.
id
The key path to the data model’s unique identifier.
children
The key path to the optional property of a data element whose value indicates the children of that element.
selection
A binding to a set which stores the selected items.
allowsMultipleSelection
A boolean value to indicate to allow multiple selections or not.
searchFilter
The closure to filter the
data
in searching process. Request a boolean by the element and the filter key.rowContent
The 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
data
The data for constructing the list picker.
id
The key path to the data model’s unique identifier.
children
The key path to the optional property of a data element whose value indicates the children of that element.
selection
A binding to a set which stores the selected items.
allowsMultipleSelection
A boolean value to indicate to allow multiple selections or not.
searchFilter
The closure to filter the
data
in searching process. Request a boolean by the element and the filter key.rowContent
The view builder which returns the content of each row in the list picker.
rowBackground
The background for the list row.
cancelAction
Customzation searchable list cancel action.
doneAction
Customzation 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 )