OK.
Let's look at the hazy stack.
So we said this stack allows us to stack things on top of each other.
All right.
So if I changes to Zee like that.
In fact let's go ahead and find as it is right now save even run.
Looks like we have a problem.
So it says that spacing extra argument pacing is being called which is not allowed.
Why is that.
Well the reason why is because we don't need spacing.
If things are actually stacked on top of each other.
Right.
Makes sense.
So that's why we're complaining here.
And to make this disappear we just get rid of it and we can get rid of all through the alignment in
everything because we don't need any of that to save this now and run we should have no problem whatsoever.
And look what's going to happen.
Everything is on top of each other.
That's exactly what is a stack does to make all of these a little bit more visible.
I'm going to change all these texts.
Let's say font let's change this one to sub headline.
This one dot font be dot.
Let's see a headline.
OK so that's looks good.
Let's save these and run.
Very good.
Still unhelpful helpful here.
So what are we going to do actually is we going to enclose all of these texts inside of different stacks.
Right.
We can actually stack stacks inside of stacks.
I'm going to put a vertical stack.
OK.
Copy this without inside the bear.
Let's just do all of this good copy like that.
Let's get rid of all of that.
Very good.
So now we have all of these stacks here and everything you can do.
You can actually select all of your code so command a and if you say control I you will indent everything
so everything looks much better.
OK.
Very good.
So now we have is this stack which contains these all these vertical stacks which in turn they contain
text.
If we run this nothing has changed except we have the same text rights organization as another.
Let's see yellow and this one just kind put.
World.
This is just to differentiate things and then make this bigger so headline gets a large title.
That's fine.
Let's say give a run
OK.
Very good.
So this is a little bit more distinct in a way that we have different text.
Very good.
So now what I'm going to do is for each stack let's add a background color and let's say background.
These are going to be color and green and these are the ones going to be background color.
Let's say the color that blue in the last one is going to be that background color.
When I say color that orange Point Light save and run
you can see now the power of the index like we said before whatever we added first is going to be in
the back.
So another which is green notice is way in the back.
We have the other v stack here which has another Halo text there and the color is blue.
And then last but not least we have another world color orange.
OK.
This one here I hope we can start seeing the power that we have using stacks right.
Using horizontal stack.
So each stack vertical stacks and of course v stack because creating this stacks it's much easier to
move things around and also a day or two the paradigm that swift brings to us which is the declarative
composing views into smaller pieces so that we can then put together a more complex user interface.
OK so what I want you to do again is play around with this concept here.
We talked about horizontal stack and vertical stack.
So go ahead and play around and start thinking may perhaps have something a little bit more elaborate
that you can put together real quick considering all the things that you've learned so far.
Very good so go ahead and knock yourself out and I'll see you in the next video.