O'Reilly logo

The Core iOS Developer’s Cookbook, Fifth Edition by Rich Wardwell, Erica Sadun

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Macros

Listing 5-1 shows a comprehensive set of macro definitions. These have been tested and are used in many recipes in this book, although they approach constraints in a fairly simple manner. Note that these macros do not return the constraints but actually add the constraints to the appropriate view. If you need to maintain access to newly created constraints for later removal, you can easily add macros that return the constraints or use the functionality in Recipe 5-1 to locate and remove constraints.

Another addition is not included in Listing 5-1 due to space limitations but is occasionally handy: variants that accept constraint constants. Such a variant can be particularly useful when aligning views to their parent and is trivial to add ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required