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


#define NSDictionaryOfVariableBindings(...)


This macro is particularly useful when creating Auto Layout constraints—see Auto Layout Guide. For example, the following code:

NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings(button1, button2);

creates the dictionary { @"button1" = button1, @"button2 = button2 }.

See Also


Positioning Content Within Layout Margins

Position views so that they are not crowded by other content.

Positioning Content Relative to the Safe Area

Position views so that they are not obstructed by other content.


The relationship between two user interface objects that must be satisfied by the constraint-based layout system.


A set of methods that provide layout support and access to layout anchors.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software