<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback"
  },
  "title" : "CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback(_:_:_:)"
}
-->

# CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback(_:_:_:)

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

```
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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)