---
title: "objectIsForced(forKey:inDomain:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/userdefaults/objectisforced(forkey:indomain:)"
---

# objectIsForced(forKey:inDomain:)

Returns a Boolean value that indicates whether an administrator provided the value for the key in the specified domain.

## Declaration

```swift
func objectIsForced(forKey key: String, inDomain domain: String) -> Bool
```

## Parameters

- `key`: The name of the key to check.
- `domain`: The domain that contains the key.

## Return Value

Return Value true if an administrator provides a value for the key, otherwise false.

## Discussion

Discussion Apps can’t change the value of managed keys, so use this method to determine if you can make changes to a key in a specific domain. For example, you might use this method to check for overrides of settings belonging to a shared app group. If a key is managed, disable any app-specific UI you use to change the value of that key.

## See Also

### Checking for managed keys

- [objectIsForced(forKey:)](foundation/userdefaults/objectisforced(forkey:).md)
