Macro

NSDictionaryOfVariableBindings

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

Declaration

#define NSDictionaryOfVariableBindings(...)

Discussion

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

Constraints

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.

NSLayoutConstraint

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

UILayoutSupport

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