Adds a subgroup to another group.


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



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


The subgroup you wish to add to group.

Return Value

Returns true if successful. If the group argument is already part of the receiver, this function does nothing and returns false. If adding the group would create a recursion, this function 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 function won’t allow.

See Also


func ABCopyArrayOfAllGroups(ABAddressBookRef!) -> Unmanaged<CFArray>!

Returns an array of all the groups in the Address Book database.

func ABGroupCopyArrayOfAllSubgroups(ABGroupRef!) -> Unmanaged<CFArray>!

Returns an array containing a group’s subgroups.

func ABGroupCopyDistributionIdentifier(ABGroupRef!, ABPersonRef!, CFString!) -> Unmanaged<CFString>!

Returns the distribution identifier for the given property and person.

func ABGroupCopyParentGroups(ABGroupRef!) -> Unmanaged<CFArray>!

Returns an array containing a group’s parents—the groups that a group belongs to.

func ABGroupSetDistributionIdentifier(ABGroupRef!, ABPersonRef!, CFString!, CFString!) -> Bool

Assigning a specific distribution identifier for a person’s multi-value list property so that the group can be used as a distribution list (mailing list, in the case of an email property).