---
title: "add(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutableset/add(_:)"
---

# add(_:)

Adds a given object to the set, if it is not already a member.

## Declaration

```swift
func add(_ object: Any)
```

## Parameters

- `object`: The object to add to the set.

## See Also

### Related Documentation

- [union(_:)](foundation/nsmutableset/union(_:).md)

### Adding and removing entries

- [filter(using:)](foundation/nsmutableset/filter(using:).md)
- [remove(_:)](foundation/nsmutableset/remove(_:).md)
- [removeAllObjects()](foundation/nsmutableset/removeallobjects().md)
- [addObjects(from:)](foundation/nsmutableset/addobjects(from:).md)
