Programmatic Auto Layout (Part 1)
So I know all about Auto Layout now - the use of constraints, content hugging, distribution....various things in the previous course! This next - and last - Treehouse course is titled 'Programmatic Auto Layout'. I assume from this that there is an element of coding to sorting out some of the layout of different views. We shall see! Why Write Code? So yes - this is what the course is exactly about! But why use code over interface builder? 1. Some developers prefer code - faster and they do not like using graphics etc. 2. IB and code do not always work so well together. Conflicts occurring etc. 3. Third party libraries - not sure about this yet. Apple have created newer APIs, to make it easier to use in code. NSLayoutConstraint... override func viewWillLayoutSubviews() { super . viewWillLayoutSubviews () redView . translatesAutoresizingMaskIntoConstraints = false ...