<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSSet/addingObjects(from:)-544m9",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSet(im)setByAddingObjectsFromArray:"
  },
  "title" : "addingObjects(from:)"
}
-->

# addingObjects(from:)

Returns a new set formed by adding the objects in a given array to the receiving set.

```
func addingObjects(from other: [Any]) -> Set<AnyHashable>
```

## Parameters

`other`

The array of objects to add to the set.

## Return Value

A new set formed by adding the objects in `other` to the receiving set.

## See Also

[`+  setWithArray:`](/documentation/Foundation/NSSet/setWithArray:)

Creates and returns a set containing a uniqued collection of the objects contained in a given array.

[`+  set`](/documentation/Foundation/NSSet/set)

Creates and returns an empty set.

[`+  setWithObjects:`](/documentation/Foundation/NSSet/setWithObjects:)

Creates and returns a set containing the objects in a given argument list.



---

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)