---
title: "ABGroupAddGroup(_:_:)"
framework: addressbook
role: symbol
role_heading: Function
path: "addressbook/abgroupaddgroup(_:_:)"
---

# ABGroupAddGroup(_:_:)

Adds a subgroup to another group.

## Declaration

```swift
func ABGroupAddGroup(_ group: ABGroupRef!, _ groupToAdd: ABGroupRef!) -> Bool
```

## Parameters

- `group`: The group you wish to add a subgroup to. If NULL, this function raises an exception.
- `groupToAdd`: The subgroup you wish to add to group.

## Return Value

Return Value Returns true ifsuccessful. If the group argumentis already part of the receiver, this function does nothing andreturns false. If adding the group wouldcreate a recursion, this function also does nothing and returns false. Forexample, if the group “Animal Lovers” is in “Dog Lovers,“and you add “Dog Lovers” to “Animal Lovers,” that wouldcreate a recursion, which this function won’t allow.

## See Also

### Groups

- [ABCopyArrayOfAllGroups(_:)](addressbook/abcopyarrayofallgroups(_:).md)
- [ABGroupAddMember(_:_:_:)](addressbook/abgroupaddmember(_:_:).md)
- [ABGroupCopyArrayOfAllMembers(_:)](addressbook/abgroupcopyarrayofallmembers(_:).md)
- [ABGroupCopyArrayOfAllSubgroups(_:)](addressbook/abgroupcopyarrayofallsubgroups(_:).md)
- [ABGroupCopyDistributionIdentifier(_:_:_:)](addressbook/abgroupcopydistributionidentifier(_:_:_:).md)
- [ABGroupCopyParentGroups(_:)](addressbook/abgroupcopyparentgroups(_:).md)
- [ABGroupCreate()](addressbook/abgroupcreate().md)
- [ABGroupCreateSearchElement(_:_:_:_:_:)](addressbook/abgroupcreatesearchelement(_:_:_:_:_:).md)
- [ABGroupRemoveGroup(_:_:)](addressbook/abgroupremovegroup(_:_:).md)
- [ABGroupRemoveMember(_:_:_:)](addressbook/abgroupremovemember(_:_:).md)
- [ABGroupSetDistributionIdentifier(_:_:_:_:)](addressbook/abgroupsetdistributionidentifier(_:_:_:_:).md)
