---
title: "CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback(_:_:_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctfontcollectioncreatematchingfontdescriptorssortedwithcallback(_:_:_:)"
---

# CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback(_:_:_:)

Returns the array of matching font descriptors sorted with the callback function.

## Declaration

```swift
func CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback(_ collection: CTFontCollection, _ sortCallback: CTFontCollectionSortDescriptorsCallback?, _ refCon: UnsafeMutableRawPointer?) -> CFArray?
```

## Parameters

- `collection`: The collection reference.
- `sortCallback`: The sorting callback function that defines the sort order.
- `refCon`: Pointer to client data define context for the callback.

## Return Value

Return Value An array of font descriptors matching the criteria of the collection sorted by the results of the sorting callback function.

## See Also

### Getting Font Descriptors

- [CTFontCollectionCreateMatchingFontDescriptors(_:)](coretext/ctfontcollectioncreatematchingfontdescriptors(_:).md)
- [CTFontCollectionCreateMatchingFontDescriptorsWithOptions(_:_:)](coretext/ctfontcollectioncreatematchingfontdescriptorswithoptions(_:_:).md)
- [CTFontCollectionCreateMatchingFontDescriptorsForFamily(_:_:_:)](coretext/ctfontcollectioncreatematchingfontdescriptorsforfamily(_:_:_:).md)
- [CTFontCollectionSortDescriptorsCallback](coretext/ctfontcollectionsortdescriptorscallback.md)
