---
title: "LSSetDefaultRoleHandlerForContentType(_:_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1444955-lssetdefaultrolehandlerforconten
---

# LSSetDefaultRoleHandlerForContentType(_:_:_:)

Sets the user’s preferred default handler for the specified content type in the specified roles.

## Declaration

```swift
func LSSetDefaultRoleHandlerForContentType(_ inContentType: CFString, _ inRole: LSRolesMask, _ inHandlerBundleID: CFString) -> OSStatus
```

## Parameters

- `inContentType`: The content type for which the default role handler is being set. The content type is a uniform type identifier.
- `inRole`: The roles for which the default role handler is being set. Pass kLSRolesAll to specify all roles. For additional possible values, see doc://com.apple.documentation/documentation/coreservices/lsrolesmask.
- `inHandlerBundleID`: The bundle identifier that is to be set as the default handler for the specified content type and roles.

## Return Value

Return Value A result code; see Result Codes.

## Discussion

Discussion Call LSCopyDefaultRoleHandlerForContentType(_:_:) to get the current setting of the user’s preferred default handler for a specified content type. Version-Notes Thread-safe since OS X v10.4.

## See Also

### Working with Role Handlers

- [LSCopyAllRoleHandlersForContentType(_:_:)](coreservices/1448020-lscopyallrolehandlersforcontentt.md)
- [LSCopyDefaultRoleHandlerForContentType(_:_:)](coreservices/1449868-lscopydefaultrolehandlerforconte.md)
- [LSSetDefaultHandlerForURLScheme(_:_:)](coreservices/1447760-lssetdefaulthandlerforurlscheme.md)
- [LSRolesMask](coreservices/lsrolesmask.md)
