API Reference / iOS InstantSearch Widgets / OneValueSwitchWidget
Apr. 24, 2019

OneValueSwitchWidget

About this widget

The OneValueSwitchWidget widget provides an on/off filtering feature based on an attribute value.

Examples

1
2
3
let oneValueSwitchWidget = OneValueSwitchWidget(frame: CGRect)
oneValueSwitchWidget.attribute = "shipping"
oneValueSwitchWidget.valueOn = "premium"

Parameters

attribute
type: string
default:
Required

The attribute that is used by the widget.

1
oneValueSwitchWidget.attribute = "shipping"
valueOn
type: string
default:
Required

The value when the toggle is on.

1
oneValueSwitchWidget.valueOn = "premium"
inclusive
type: Bool
default: true
Optional

Whether the refinement is inclusive or exclusive.

1
oneValueSwitchWidget.inclusive = true

FacetControlViewModel

Use this to customize any kind of facet control view.

Methods

  • addFacet(value:doSearch:)
  • updatefacet(oldValue:newValue:doSearch:)
  • removeFacet(value:)

Did you find this page helpful?