Daily iOS
UIKit

Auto Layout basics

How is an Auto Layout constraint represented internally, as a formula?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

One constraint is a linear equation: one view's attribute equals another view's attribute times a multiplier plus a constant. The relation can be equal, greater than or equal, or less than or equal, each equation carries a priority, and the engine solves the system to set each view's frame.

Share a question