---
title: "LSCopyAllRoleHandlersForContentType(_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1448020-lscopyallrolehandlersforcontentt
---

# LSCopyAllRoleHandlersForContentType(_:_:)

Locates an array of bundle identifiers for apps capable of handling a specified content type with the specified roles.

## Declaration

```swift
func LSCopyAllRoleHandlersForContentType(_ inContentType: CFString, _ inRole: LSRolesMask) -> Unmanaged<CFArray>?
```

## Parameters

- `inContentType`: The content type. The content type is a uniform type identifier.
- `inRole`: The role. Pass kLSRolesAll if any role is acceptable. For additional possible values, see doc://com.apple.documentation/documentation/coreservices/lsrolesmask.

## Return Value

Return Value The bundle identifiers for apps capable of handling the specified content type in the specified roles, or NULL if no handlers are available. In macOS 10.15 and later, the returned array is sorted so that the first element contains the bundle identifier of the best available app for opening the content type. Prior to macOS 10.15, the order of elements in the array was undefined.

## Discussion

Discussion This function returns all of the bundle identifiers that are capable of handling the specified content type in the specified roles. The CFBundleDocumentTypes key in an app’s Info.plist can be used to set an app’s content handling capabilities. The LSItemContentTypes key is particularly useful because it supports the use of UTIs in document claims. Version Notes Thread-safe since macOS 10.4.

## See Also

### Working with Role Handlers

- [LSCopyDefaultRoleHandlerForContentType(_:_:)](coreservices/1449868-lscopydefaultrolehandlerforconte.md)
- [LSSetDefaultRoleHandlerForContentType(_:_:_:)](coreservices/1444955-lssetdefaultrolehandlerforconten.md)
- [LSSetDefaultHandlerForURLScheme(_:_:)](coreservices/1447760-lssetdefaulthandlerforurlscheme.md)
- [LSRolesMask](coreservices/lsrolesmask.md)
