<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AddressBook",
  "identifier" : "/documentation/AddressBook/ABGroupAddGroup(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Address Book"
    ],
    "preciseIdentifier" : "c:@F@ABGroupAddGroup"
  },
  "title" : "ABGroupAddGroup(_:_:)"
}
-->

# ABGroupAddGroup(_:_:)

Adds a subgroup to another group.

```
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

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.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)