---
title: "predicateForGroupsInContainer(withIdentifier:)"
framework: contacts
role: symbol
role_heading: Type Method
path: "contacts/cngroup/predicateforgroupsincontainer(withidentifier:)"
---

# predicateForGroupsInContainer(withIdentifier:)

Returns a predicate to find groups in the specified container.

## Declaration

```swift
class func predicateForGroupsInContainer(withIdentifier containerIdentifier: String) -> NSPredicate
```

## Parameters

- `containerIdentifier`: The container identifier to be matched.

## Return Value

Return Value A predicate that you can use to fetch groups from CNContactStore.

## See Also

### Generating Search Predicates for Groups

- [predicateForGroups(withIdentifiers:)](contacts/cngroup/predicateforgroups(withidentifiers:).md)
- [predicateForSubgroupsInGroup(withIdentifier:)](contacts/cngroup/predicateforsubgroupsingroup(withidentifier:).md)
