<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLModelAsset/functionNames(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core ML"
    ],
    "preciseIdentifier" : "c:objc(cs)MLModelAsset(im)functionNamesWithCompletionHandler:"
  },
  "title" : "functionNames(completionHandler:)"
}
-->

# functionNames(completionHandler:)

The list of function names in the model asset.

```
func functionNames(completionHandler handler: @escaping @Sendable ([String]?, (any Error)?) -> Void)
```

## Discussion

Some model types (e.g. ML Program) supports multiple functions. Use this method to query the function names.

The method vends the empty array when the model doesn’t use the multi-function configuration.

```swift
let modelAsset = try MLModelAsset(url: modelURL)
let functionNames = try await modelAsset.functionNames
print(functionNames) // For example, ["my_function1", "my_function2"];
```

---

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)