Filter Selection View
Last Updated - Platform 19.0.0 - SDK 14.0.0The FilterSelectionView
is the main view of a FilterSelectionViewController
to present the selectable filters.
The PoqFilterSelectionView
(default) variation of this view:
- Presents a
tableView
of filter views using aFilterSelectionViewDataSource
. - Presents an
Apply
button at the bottom of the view.
Container.shared.views.filterSelectionView = { PoqFilterSelectionView()}
To add custom filters you must customise:
- the
FilterSelectionViewDataSource
andFilterViewDataMapper
to present the custom filter view. - the
FilterSelectionViewController
to handle selection changes.
Data Source
The FilterSelectionViewDataSource
for a PoqFilterSelectionView
to present the filter views based on filter types.
Container.shared.dataSources.filterSelectionViewDataSource = { FilterSelectionViewDataSource()}
View Data Mappers
At current view data is specific to PoqView implementations. This is likely to change in the future to allow more flexibility.
The FilterSelectionViewDataMapper
to map from the FilterSelectionState
to the FilterSelectionViewData
to present.
Container.shared.mappers.filterSelectionViewDataMapper = { PoqFilterSelectionViewDataMapper()}
The FilterViewDataMapper
to map from a Filter
to the FilterViewData
to presents. This mapper:
- Maps
FilterListViewData
from.list
to presentFilterListView
(list filters). - Maps
FilterPriceViewData
from.price
to presentFilterPriceView
(price filters). - Maps
FilterToggleViewData
from.toggle
to presentFilterToggleView
(toggle filters).
Container.shared.mappers.filterViewDataMapper = { PoqFilterViewDataMapper()}