1 00:00:00,420 --> 00:00:02,900 Let's take a look at what's happening here. 2 00:00:02,910 --> 00:00:08,940 Let's open our left pan here a project you can see that we have content viewed as Swifty y that is the 3 00:00:08,940 --> 00:00:15,450 file that we have opened here inside of this file we have the import so it's important Swifty y frameworks 4 00:00:15,530 --> 00:00:22,260 that we can have access of the basics of what Swifty White does which in this case being able to display 5 00:00:22,260 --> 00:00:26,200 something on screen all of that happens inside of our content view. 6 00:00:26,220 --> 00:00:29,790 The strike strike is just a simple version of the class if you will. 7 00:00:29,790 --> 00:00:32,080 So here all have saying content view here. 8 00:00:32,160 --> 00:00:34,740 It's actually inheriting from view. 9 00:00:34,800 --> 00:00:39,840 So this view would suggest another protocol big class that is somewhere in our library and swift UI 10 00:00:39,840 --> 00:00:45,930 framework that contains ways in which we can actually display stuff on display things on the screen. 11 00:00:45,930 --> 00:00:50,030 Notice also you will notice that everything in software is indeed a view. 12 00:00:50,070 --> 00:00:53,090 So in our content view here we need to return something. 13 00:00:53,130 --> 00:00:56,430 There's some things going to be in a form of a variable called body. 14 00:00:56,490 --> 00:01:00,540 In this case here we are saying this body here is going to be some sort of review that is not specific 15 00:01:00,750 --> 00:01:05,730 meaning that in this case here we are passing a text that could have passed some other types of views. 16 00:01:05,760 --> 00:01:10,020 This would work because we are saying we just want to return a very generic feel. 17 00:01:10,020 --> 00:01:14,280 So any view it's going to be able to be returned and show. 18 00:01:14,340 --> 00:01:18,540 Now there is a different kind of syntax here you can see because you could say Well where is that return. 19 00:01:18,560 --> 00:01:24,420 Yes we could say something like this return such that still works in fact if I save and give it a run 20 00:01:25,010 --> 00:01:26,960 it's still works fine no problem. 21 00:01:26,970 --> 00:01:32,310 But with the U.S. for UI you don't have to add this return keyword it's assumed that you're returning 22 00:01:32,310 --> 00:01:33,560 something inside of this body. 23 00:01:33,930 --> 00:01:34,680 OK. 24 00:01:35,040 --> 00:01:35,490 There we go. 25 00:01:35,490 --> 00:01:36,660 And what are we returning. 26 00:01:36,660 --> 00:01:42,330 Again it is a text which is a view and because it's a text instead of double quotes the text that we 27 00:01:42,330 --> 00:01:46,740 want in this case well the world Paolo and you can see hello world Paolo there. 28 00:01:47,340 --> 00:01:51,170 Now they strike to here content view preview is what I said before. 29 00:01:51,240 --> 00:01:57,660 It is indeed what is run when we have our preview to the right here in this case because I'm not running 30 00:01:57,660 --> 00:02:00,930 on Catalina I'm still more Harvey I don't have that preview. 31 00:02:00,940 --> 00:02:06,800 But if you're running Catalina you should see a preview so that you don't have to actually run the simulator. 32 00:02:06,800 --> 00:02:10,260 I like running simulator in a way this works fine. 33 00:02:10,260 --> 00:02:14,730 So doing pretty much same thing we did here and said we are calling this content view that we created 34 00:02:14,760 --> 00:02:20,100 at the top here to preview all of that which we can't see again for the reasons you just said very good. 35 00:02:20,100 --> 00:02:24,930 So now we have our tax here the beauty here is that we can do all sorts of things with our views. 36 00:02:25,140 --> 00:02:30,990 That's the beauty of Swifty y for instance there's these things called modifiers modifiers are just 37 00:02:30,990 --> 00:02:34,050 functions we can call on a view. 38 00:02:34,080 --> 00:02:34,410 Right. 39 00:02:34,680 --> 00:02:38,520 So there are a lot of modifiers we can call upon our viewers. 40 00:02:38,550 --> 00:02:41,990 The first one is for things I can say dot I can make it bold. 41 00:02:42,030 --> 00:02:47,990 Notice the moment you need to put dot the operator dot here it gives us some sort of a guidance Intel 42 00:02:48,000 --> 00:02:49,550 a sense of things that we might want to do. 43 00:02:49,590 --> 00:02:51,870 So we can make the text bold. 44 00:02:51,870 --> 00:02:55,320 We can't actually pass a font for your text in so many other things. 45 00:02:55,320 --> 00:02:56,740 Let's start with italic. 46 00:02:56,910 --> 00:03:02,580 Now the other thing I like to make it is that I like to put all of my modifiers kind of indent and inside 47 00:03:02,580 --> 00:03:03,030 like that. 48 00:03:03,180 --> 00:03:05,130 OK just good practice. 49 00:03:05,130 --> 00:03:09,330 If I save and give it a ride I'm going to see that our hello world is going to be italic. 50 00:03:09,330 --> 00:03:12,710 Now and while it's italic. 51 00:03:12,710 --> 00:03:13,570 Very good. 52 00:03:13,580 --> 00:03:23,440 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. 53 00:03:23,480 --> 00:03:29,050 You should see that's going to be a bolder color and there we go. 54 00:03:29,250 --> 00:03:32,340 Hello world is indeed all bold. 55 00:03:32,340 --> 00:03:36,240 Now I can continue adding other modifiers. 56 00:03:36,240 --> 00:03:39,570 That's a dark font because I'm invoking modifier in here. 57 00:03:39,570 --> 00:03:46,790 I can also use a dot operator also to get a few of other options that I would have for funds. 58 00:03:46,910 --> 00:03:54,100 You can see here we can have body call out headline large title sub headline font title all of these 59 00:03:54,100 --> 00:03:59,130 you can play around with for the title obviously is going to make hello world to be more of a title 60 00:03:59,140 --> 00:04:03,810 so if I run these again you should see probably something different. 61 00:04:03,870 --> 00:04:10,050 Well now you see it is indeed bigger and as a title let's go play around with something more perhaps 62 00:04:10,050 --> 00:04:18,230 I want this to be how about headline just to see what's going on and why. 63 00:04:18,280 --> 00:04:22,720 So it kind of changed a little bit to maybe not noticeably so but at least you can see that you can 64 00:04:22,720 --> 00:04:25,510 change our views using modifier just like that. 65 00:04:25,840 --> 00:04:26,890 And I can continue. 66 00:04:26,890 --> 00:04:33,790 In fact if I wanted to make this strike through I can just go like that save and run then I noticed. 67 00:04:33,790 --> 00:04:38,340 Going to have a line going through hello world Paolo. 68 00:04:38,350 --> 00:04:39,310 Very nice. 69 00:04:39,310 --> 00:04:41,560 And so many many other things we can do. 70 00:04:41,620 --> 00:04:45,050 Let's say we want to change the color of our text. 71 00:04:45,130 --> 00:04:49,000 Well I can also do that I can come down here at the end if I wish to do so. 72 00:04:49,000 --> 00:04:52,960 Doesn't really matter where I can say for ground color. 73 00:04:52,960 --> 00:04:59,020 Now it used to be that you could just come and say color as such and try to pass something but it doesn't 74 00:04:59,050 --> 00:05:03,490 work anymore because that's deprecated but you don't have to worry about it because we have updated 75 00:05:03,490 --> 00:05:04,530 everything. 76 00:05:04,810 --> 00:05:11,050 So foreground color in order for us to actually give a color to our text which is a view in this case 77 00:05:11,050 --> 00:05:17,590 here I can go ahead and say dot and get at least some of the axon collars that we have already available 78 00:05:17,590 --> 00:05:17,980 to us. 79 00:05:17,980 --> 00:05:20,970 Right so I can say I want clear or gray. 80 00:05:21,000 --> 00:05:22,360 Let's start gray like this 81 00:05:26,550 --> 00:05:28,020 and you can see it's gray. 82 00:05:28,560 --> 00:05:31,110 I can go and say that pink like this 83 00:05:34,110 --> 00:05:36,960 and you can see the colors are changing and it's looking really nice. 84 00:05:36,960 --> 00:05:42,210 Let's go back to a title like that so you can probably see better 85 00:05:45,820 --> 00:05:50,970 so as you can see there's so many things you can do easily with tax or any view in this case. 86 00:05:50,980 --> 00:05:56,320 So you can use modifiers or functions as you call here to modify our text as such. 87 00:05:56,650 --> 00:05:58,780 So what I want you to do is to play around with concept. 88 00:05:58,780 --> 00:06:04,900 Go ahead and find other modifiers to see if you can change your text to go ahead and play around with 89 00:06:04,930 --> 00:06:06,490 concept and I'll see in the next video.