March 2014
Intermediate to advanced
672 pages
40h 11m
English
When you don’t know a constant’s value (like 120 or 50) a priori, use a metrics dictionary to provide the value. This dictionary is passed as one of the parameters to the constraint creation method. Here is an example of a format string that uses a metric stand-in:
[view1(>=minwidth)]
The minwidth stand-in must map to an NSNumber value in the passed metric dictionary. For more examples of metric use, refer to Recipe 5-2’s constrainSize: method. It demonstrates how to use metrics, using values from an associated dictionary in its constraints.
Read now
Unlock full access