Category Archives for Auto Layout

Easy And Flexible Forms In iOS With Interface Builder

This post looks at how to easily design future-proof data entry forms in iOS with Interface Builder. It includes a demo app written in Swift. There are some libraries written to help with creating forms,

Continue reading

Content Hugging and Compression Resistance Explained

This post takes a detailed look at Content Hugging Priority and Compression Resistance Priority. It is an interactive discussion with examples so if you can perform the steps in this post yourself, you’ll

Continue reading

UIStackView For Showing And Hiding User Interface Controls

Let’s take a look at a very useful feature of UIStackView: showing and hiding user interface controls. In an earlier tutorial, I demonstrated how to implement a custom edit button in each row for

Continue reading

UITableView Blur Background Including Rotation Support

Let’s build a beautiful UITableView that has a UIVisualEffectView with a UIBlurEffect. Let’s also go further and avoid a common problem of the blur being offset from the underlying image

Continue reading

When To Set Constraint Priority Less Than 1000 – A Case Study

Have you completed an entire app without ever deviating from the default constraint priority of 1000? Let’s take a look at an example of when you can leverage the ability to lower the constraint

Continue reading

setNeedsDisplay And drawRect Explained

In my previous post, I explained the difference between setNeedsLayout and layoutIfNeeded. This post covers another related and important method of UIView, which is setNeedsDisplay. 29 March 2017: Please

Continue reading

setNeedsLayout vs layoutIfNeeded Explained

Let’s take a look at the difference between setNeedsLayout and layoutIfNeeded. This post will explain the difference using a concrete example of animating constraint changes. Before discussing both

Continue reading

How To Access Storyboard and Xib Constraints in Code

A reader commented on a previous tutorial about not having realized that you can access a constraint (NSLayoutConstraint) in code just like you can any UIKit component such as a button or label. Let’s

Continue reading