> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sorting refinements

> Learn how to sort your refinement lists with InstantSearch iOS.

<Info>
  Starting May 1, 2024,
  Apple requires all iOS apps to include a privacy manifest.
  For more information, see [Privacy manifest](/doc/guides/building-search-ui/resources/privacy-manifest/ios/).
</Info>

## Sort refinements

You can sort refinement lists alphabetically or by count. For each option, you can choose ascending or descending order.

## Example

You can specify the sort order of the `RefinementTableWidget` or `RefinementCollectionWidget` by using the `sortBy` property:

```swift Swift icon=code theme={"system"}
refinementTableWidget.sortBy = "count:asc"
refinementTableWidget.sortBy = "count:desc"
refinementTableWidget.sortBy = "name:asc"
refinementTableWidget.sortBy = "name:desc"

refinementCollectionWidget.sortBy = "count:asc"
refinementCollectionWidget.sortBy = "count:desc"
refinementCollectionWidget.sortBy = "name:asc"
refinementCollectionWidget.sortBy = "name:desc"
```
