From the course: iOS Development: Auto Layout Programmatically

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Visual Format basics

Visual Format basics - iOS Tutorial

From the course: iOS Development: Auto Layout Programmatically

Start my 1-month free trial

Visual Format basics

- [Narrator] The visual format language tries to describe the layout of your cell views based on a character sequence. Unlike specifically setting pins and aligns, you draw a picture with text and do alignment with the options parameter. This takes a bit of shifting your mind around from the explicit constraints we learned earlier. Let's learn the basics of the visual language. Images will get a little confusing here at first. So in preparation, towards the top of the code I'm gonna hide the image view. Now I'm gonna start with my horizontal constraints. And I'm gonna use the order button for an example here. So what we're gonna do is let horizontal constraints equals H colon pipe dash square brackets dash pipe and in the square brackets I'm gonna put back button like so. So you have several symbols going on here. The first one is the pipe symbol. That's a shorthand for the super view. You can specify a leading, in this case, or trailing in this case, top or bottom for the vertical…

Contents