From the course: Complete Guide to SwiftUI

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Arranging views

Arranging views

- [Instructor] We're ready to arrange views. The iPhone portrait is the view we've been using for the course. So that stays the same. When not in portrait, we'll put the image and description side by side. If in iPhone and landscape, I'll hide the suggestion. To help us, let's also detect an iPhone in portrait just like we did up here with the all regular. So I just actually have to copy this and change the size classes for it. So I'm going to copy this and paste it. I'm going to change this to his portrait. And here the vertical size class is going to be regular and the horizontal size class is going to be compact. Now back into the body here, and we're going to start here in this V stack, just above the A stack where we got the buttons. We're going to start, if its portrait, then we're going to put a V stack, everything we had it the way before. Else, I'll make another V stack with our new configuration, which we'll have side by side stuff with H stacks as well in there. So the easy…

Contents