Let's take a look at what's happening here.
Let's open our left pan here a project you can see that we have content viewed as Swifty y that is the
file that we have opened here inside of this file we have the import so it's important Swifty y frameworks
that we can have access of the basics of what Swifty White does which in this case being able to display
something on screen all of that happens inside of our content view.
The strike strike is just a simple version of the class if you will.
So here all have saying content view here.
It's actually inheriting from view.
So this view would suggest another protocol big class that is somewhere in our library and swift UI
framework that contains ways in which we can actually display stuff on display things on the screen.
Notice also you will notice that everything in software is indeed a view.
So in our content view here we need to return something.
There's some things going to be in a form of a variable called body.
In this case here we are saying this body here is going to be some sort of review that is not specific
meaning that in this case here we are passing a text that could have passed some other types of views.
This would work because we are saying we just want to return a very generic feel.
So any view it's going to be able to be returned and show.
Now there is a different kind of syntax here you can see because you could say Well where is that return.
Yes we could say something like this return such that still works in fact if I save and give it a run
it's still works fine no problem.
But with the U.S. for UI you don't have to add this return keyword it's assumed that you're returning
something inside of this body.
OK.
There we go.
And what are we returning.
Again it is a text which is a view and because it's a text instead of double quotes the text that we
want in this case well the world Paolo and you can see hello world Paolo there.
Now they strike to here content view preview is what I said before.
It is indeed what is run when we have our preview to the right here in this case because I'm not running
on Catalina I'm still more Harvey I don't have that preview.
But if you're running Catalina you should see a preview so that you don't have to actually run the simulator.
I like running simulator in a way this works fine.
So doing pretty much same thing we did here and said we are calling this content view that we created
at the top here to preview all of that which we can't see again for the reasons you just said very good.
So now we have our tax here the beauty here is that we can do all sorts of things with our views.
That's the beauty of Swifty y for instance there's these things called modifiers modifiers are just
functions we can call on a view.
Right.
So there are a lot of modifiers we can call upon our viewers.
The first one is for things I can say dot I can make it bold.
Notice the moment you need to put dot the operator dot here it gives us some sort of a guidance Intel
a sense of things that we might want to do.
So we can make the text bold.
We can't actually pass a font for your text in so many other things.
Let's start with italic.
Now the other thing I like to make it is that I like to put all of my modifiers kind of indent and inside
like that.
OK just good practice.
If I save and give it a ride I'm going to see that our hello world is going to be italic.
Now and while it's italic.
Very good.
So if I want to make this bold I can put at the top there the DOT say dot bold like this save and run.
You should see that's going to be a bolder color and there we go.
Hello world is indeed all bold.
Now I can continue adding other modifiers.
That's a dark font because I'm invoking modifier in here.
I can also use a dot operator also to get a few of other options that I would have for funds.
You can see here we can have body call out headline large title sub headline font title all of these
you can play around with for the title obviously is going to make hello world to be more of a title
so if I run these again you should see probably something different.
Well now you see it is indeed bigger and as a title let's go play around with something more perhaps
I want this to be how about headline just to see what's going on and why.
So it kind of changed a little bit to maybe not noticeably so but at least you can see that you can
change our views using modifier just like that.
And I can continue.
In fact if I wanted to make this strike through I can just go like that save and run then I noticed.
Going to have a line going through hello world Paolo.
Very nice.
And so many many other things we can do.
Let's say we want to change the color of our text.
Well I can also do that I can come down here at the end if I wish to do so.
Doesn't really matter where I can say for ground color.
Now it used to be that you could just come and say color as such and try to pass something but it doesn't
work anymore because that's deprecated but you don't have to worry about it because we have updated
everything.
So foreground color in order for us to actually give a color to our text which is a view in this case
here I can go ahead and say dot and get at least some of the axon collars that we have already available
to us.
Right so I can say I want clear or gray.
Let's start gray like this
and you can see it's gray.
I can go and say that pink like this
and you can see the colors are changing and it's looking really nice.
Let's go back to a title like that so you can probably see better
so as you can see there's so many things you can do easily with tax or any view in this case.
So you can use modifiers or functions as you call here to modify our text as such.
So what I want you to do is to play around with concept.
Go ahead and find other modifiers to see if you can change your text to go ahead and play around with
concept and I'll see in the next video.