add_sorter


Description:

public void add_sorter (uint category_index, string field, SortFlags flags)

Sort data in a given category by values of 'field'.

Aggregating results from multiple scopes often needs a clear way to sort the results, to do that you can define category-specific sorting rules. As an example, a category displaying recent items might be sorted using a "timestamp" field (which would be defined as either a required or optional metadata field Unity.Scope.metadata_schema). For categories that don't have any obvious order it is recommended to sort them according to the "title" field.

Parameters:

category_index

Index of the sorted category

field

Name of the field the order will be based on

flags

The way sorting is performed