From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Inequalities in Auto Layout for storyboards

Inequalities in Auto Layout for storyboards

From the course: iOS Development Tips

Inequalities in Auto Layout for storyboards

- [Instructor] You might have run into some problems with Autolayout in the Xcode 10 storyboard. It's a lot crankier than previous versions throwing warnings at you for layout that was perfectly legal in Xcode 9. Let's go take a look at how to resolve these errors, and a feature of Autolayout you may not be using. If you've downloaded the example file, you'll find a storyboard where I've set it an image, a label and a view to help visibility of the label over the Popcorn image. I want my label pinned 20 points from the top and 20 points from the left inside the view. There's two approaches here I can try. The first is to make the label a sub view of the solid blue background. I drag the label on top of the view and you'll see in the outline, it becomes a sub view. Xcode is already complaining that there are no constraints on it. I'll select the popcorn label and pin it 20 from the top and 20 from the leading edge and add those two constraints and there we go. I got another error…

Contents