---
title: "sorted(using:)"
framework: swift-package-manager
role: symbol
role_heading: Instance Method
path: "swift-package-manager/documentation/packageplugin/filelist/sorted(using:)-6s1a2"
---

# sorted(using:)

Inherited from Sequence.sorted(using:).

## Declaration

```swift
func sorted<Comparator>(using comparator: Comparator) -> [Self.Element] where Comparator : SortComparator, Self.Element == Comparator.Compared
```
