<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/NSDictionaryOfVariableBindings",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@macro@NSDictionaryOfVariableBindings"
  },
  "title" : "NSDictionaryOfVariableBindings"
}
-->

# NSDictionaryOfVariableBindings

Creates a dictionary wherein the keys are string representations of the corresponding values’ variable names.

```
#define NSDictionaryOfVariableBindings(...)
```

## Discussion

This macro is particularly useful when creating Auto Layout constraints. For example, the following code creates the dictionary `{ @"button1" = button1, @"button2" = button2 }`.

```objc
NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings(button1, button2);
```

---

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)