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

# objectIsForced(forKey:)

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

## Declaration

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

## Parameters

- `key`: The name of the key to check.

## 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 one of your app-specific keys. 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:inDomain:)](foundation/userdefaults/objectisforced(forkey:indomain:).md)
