---
title: "addSubgroup(_:)"
framework: addressbook
role: symbol
role_heading: Instance Method
path: "addressbook/abgroup/addsubgroup(_:)"
---

# addSubgroup(_:)

Adds a subgroup to another group.

## Declaration

```swift
func addSubgroup(_ group: ABGroup!) -> Bool
```

## Parameters

- `group`: The group to add as a subgroup.

## Return Value

Return Value true if successful; otherwise, false.

## Discussion

Discussion If the group argument is already part of the receiver, this method does nothing and returns false. If adding the group would create a recursion, this method also does nothing and returns false. (For example, if the group Animal Lovers is in Dog Lovers, and you add Dog Lovers to Animal Lovers, that would create a recursion, which this method won’t allow.) If the group argument is nil, this method raises an exception.

## See Also

### Managing subgroups

- [removeSubgroup(_:)](addressbook/abgroup/removesubgroup(_:).md)
- [parentGroups()](addressbook/abgroup/parentgroups().md)
- [subgroups()](addressbook/abgroup/subgroups().md)
