<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMetadataItem/values(forAttributes:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMetadataItem(im)valuesForAttributes:"
  },
  "title" : "values(forAttributes:)"
}
-->

# values(forAttributes:)

Returns a dictionary containing the key-value pairs for the attribute names specified by a given array of keys.

```
func values(forAttributes keys: [String]) -> [String : Any]?
```

## Parameters

`keys`

An array containing `NSString` objects that specify the names of a metadata attributes. See the “Constants” section for a list of possible keys.

## Return Value

A dictionary containing the key-value pairs for the attribute names specified by `keys`.

---

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)