---
title: "addSubgroup(_:to:)"
framework: contacts
role: symbol
role_heading: Instance Method
path: "contacts/cnsaverequest/addsubgroup(_:to:)"
---

# addSubgroup(_:to:)

Add the specified group to a parent group.

## Declaration

```swift
func addSubgroup(_ subgroup: CNGroup, to group: CNGroup)
```

## Parameters

- `subgroup`: The subgroup to add.
- `group`: The parent group in which to add subgroup.

## Discussion

Discussion If you previously tried to remove subgroup from group in the same save request, calling this method undoes that removal. The last change you make is the one that takes effect.

## See Also

### Adding and removing subgroups

- [removeSubgroup(_:from:)](contacts/cnsaverequest/removesubgroup(_:from:).md)
