1 00:00:00,120 --> 00:00:05,480 So we've added this H stack here and I said earlier that this will become more apparent at a later time. 2 00:00:05,490 --> 00:00:07,680 So this is the later time if you will. 3 00:00:07,680 --> 00:00:13,320 So if we click on one of these braces there you notice that this highlights that just tells us that 4 00:00:13,320 --> 00:00:17,730 is the enclosing or where these H stack ends. 5 00:00:17,730 --> 00:00:23,680 Now I can actually add a background color because we want to make sure we have this very nice background 6 00:00:23,700 --> 00:00:24,870 it looks like a card. 7 00:00:24,930 --> 00:00:29,320 So we're going to do that in the main or the parent enclosing stack right. 8 00:00:29,330 --> 00:00:33,890 And I know that again by clicking There you can see these highlighted so I can come down here and a 9 00:00:33,960 --> 00:00:40,380 dot and I'm going go and invoke the background a background like that and we can pass a view. 10 00:00:40,530 --> 00:00:45,090 And as I said before if you could be anything so color orange. 11 00:00:45,150 --> 00:00:45,350 OK. 12 00:00:45,360 --> 00:00:47,030 So whenever one of more colors. 13 00:00:47,070 --> 00:00:51,360 It's always best to just go through the class color and go get the orange. 14 00:00:51,360 --> 00:00:54,110 Now let's save this and see what's going to happen. 15 00:00:54,150 --> 00:00:58,620 Let me do that you can see now we have that nice orange color looking really good there. 16 00:00:58,680 --> 00:01:01,710 But the problem here is that everything is squished in. 17 00:01:01,710 --> 00:01:04,980 And we don't have breathing space or padding around. 18 00:01:05,040 --> 00:01:12,450 Now we could if we want it we could have just come here and say we want to add a padding like that and 19 00:01:12,540 --> 00:01:18,310 dot all to say all around we want a pattern of 989 for instance and run this. 20 00:01:18,470 --> 00:01:19,740 Let's see what's going to happen. 21 00:01:22,570 --> 00:01:23,650 Nothing really happens. 22 00:01:23,930 --> 00:01:24,470 OK. 23 00:01:24,550 --> 00:01:27,190 It gives us the padding inside but that's not what we want. 24 00:01:27,190 --> 00:01:28,630 So what do we need to do. 25 00:01:28,630 --> 00:01:33,970 Actually here is to change the frame meaning this whole frame enclosing our text. 26 00:01:34,060 --> 00:01:38,920 So I'm gonna put first there instead of second and then say dot frame. 27 00:01:38,940 --> 00:01:43,900 Okay so the frame is the whole view that we are using or we are creating at this moment. 28 00:01:44,290 --> 00:01:50,260 So we gonna use that frame and we're gonna pass a few things with our frame and say with one the width 29 00:01:50,260 --> 00:01:53,530 of the frame to be 380 in height. 30 00:01:53,530 --> 00:01:56,640 I wanted to be about 200 units. 31 00:01:56,840 --> 00:02:01,660 Okay so now we are specifying the width of our view. 32 00:02:01,660 --> 00:02:06,990 In this case in the background as well as the height let's say this huh. 33 00:02:07,080 --> 00:02:08,680 It looks much much better. 34 00:02:08,760 --> 00:02:09,300 You'd notice. 35 00:02:09,310 --> 00:02:14,940 Now we have what we need which is the bigger card and everything is in the middle. 36 00:02:14,940 --> 00:02:19,260 Now the great thing here is that we can continue adding other modifiers for instance if we wanted to 37 00:02:19,260 --> 00:02:21,230 add some sort of a corner radius. 38 00:02:21,240 --> 00:02:22,470 We can do that right. 39 00:02:22,470 --> 00:02:26,240 It's a type view as you can see there and we can pass through radius. 40 00:02:26,310 --> 00:02:30,780 Meaning how round do we want these sides to be. 41 00:02:30,780 --> 00:02:31,670 Okay. 42 00:02:31,680 --> 00:02:39,660 In this case I just wanted to be about eight save and run we'll should see Whyalla. 43 00:02:39,720 --> 00:02:47,760 Very nice rounded corners like that of course can change and play around with the number as you wish. 44 00:02:48,100 --> 00:02:51,550 And we are going to add some shadow radius here we can pass. 45 00:02:51,700 --> 00:02:57,160 And this case we want to just say five to give it this nice shadow to our card. 46 00:02:57,280 --> 00:03:02,620 So it looks like it's actually pulled up a little bit you can see now there is a very nice shadow around 47 00:03:02,980 --> 00:03:08,950 our card and just like that you can see the difference we made it just by adding the background and 48 00:03:08,950 --> 00:03:10,900 a little bit of corners it shatters and so forth. 49 00:03:11,260 --> 00:03:11,830 OK. 50 00:03:11,980 --> 00:03:17,580 At this point here we can actually change our colors of our text because now we have a nice background. 51 00:03:17,680 --> 00:03:25,300 So in this case here and so grey and when I say white and let's see this pink is fine let's make this 52 00:03:25,300 --> 00:03:28,690 white all the text is white and this is white as well. 53 00:03:28,690 --> 00:03:29,500 So save this. 54 00:03:29,500 --> 00:03:34,930 Now we should see a more desirable and good looking hopefully card. 55 00:03:34,930 --> 00:03:35,770 There we go. 56 00:03:35,770 --> 00:03:37,420 Very very nice. 57 00:03:37,420 --> 00:03:42,880 Now the next thing we want to do is we want to be able to add that nice image of Mr. Politician on yours 58 00:03:42,880 --> 00:03:45,100 truly to the left here. 59 00:03:45,100 --> 00:03:46,450 Now how do we do that. 60 00:03:46,450 --> 00:03:52,420 Well there's reason why I made all of these to be inside of a stack page stack against ends where A 61 00:03:52,420 --> 00:03:57,370 HORIZONTAL STACK meaning everything that we put inside of it is going to be horizontally aligned. 62 00:03:57,370 --> 00:04:03,340 That means if I put an image right after our H stack we should be able to have it around here. 63 00:04:03,340 --> 00:04:09,280 This makes sense because anything else we have this stack which we made sure so we can add all of these 64 00:04:09,340 --> 00:04:11,160 vertically inside. 65 00:04:11,230 --> 00:04:16,780 We have these H stack because we wanted to make sure at least this t the actual Twitter address are 66 00:04:16,780 --> 00:04:17,530 side by side. 67 00:04:17,530 --> 00:04:19,280 That's why we have the g h stack. 68 00:04:19,480 --> 00:04:26,040 I hope you started to see the thought process in Swifty y as we stack things around on screen. 69 00:04:26,080 --> 00:04:31,320 That means now I can come down here and add the image and we know how to do that now. 70 00:04:31,360 --> 00:04:33,940 So I'm going to say image like that. 71 00:04:34,330 --> 00:04:36,080 Now I'm not going to pass this system image. 72 00:04:36,130 --> 00:04:42,250 I'm going to actually pass the image name which you should have added to your assets. 73 00:04:42,250 --> 00:04:48,220 So the image name is this once it's gone Apollo's dash nice dash photo has to be exactly the same. 74 00:04:48,220 --> 00:04:51,550 So I can invoke that because inside of our assets. 75 00:04:51,550 --> 00:04:56,890 So Paolo's dash nice photo I such. 76 00:04:57,190 --> 00:05:02,360 Let's save this and see if it's actually going to show Whyalla. 77 00:05:02,540 --> 00:05:08,250 We have a problem here it looks like it took over the entirety of our card which is not exactly a good 78 00:05:08,250 --> 00:05:09,240 look at all. 79 00:05:09,240 --> 00:05:16,110 So we need to change this how do we do that well just like any other view we can pass few modifiers 80 00:05:16,140 --> 00:05:16,950 as well. 81 00:05:16,950 --> 00:05:22,050 The first one we need to pass is we sizeable to tell the system that this image indeed we want to make 82 00:05:22,050 --> 00:05:27,600 sure that is a sizable and the next one I'm going to pass in a frame up because I want it to be a certain 83 00:05:27,600 --> 00:05:28,330 size. 84 00:05:28,440 --> 00:05:35,760 I'm going to make width to be about let's say 180 and also 180 for the height. 85 00:05:35,760 --> 00:05:40,890 Actually any to say height like this named properties. 86 00:05:40,900 --> 00:05:45,210 And there's another property in pass here called alignment right. 87 00:05:45,240 --> 00:05:47,870 So this alignment I want this to be center. 88 00:05:47,880 --> 00:05:53,410 So this photo here whenever we put that inside of this frame I want this to be in a middle. 89 00:05:53,680 --> 00:05:54,060 OK. 90 00:05:54,150 --> 00:06:01,940 Let's save this and see Ha ha looks much much better but he can see now we still have a few problems 91 00:06:01,940 --> 00:06:02,380 here. 92 00:06:02,390 --> 00:06:08,660 First of all we still have this issue of very sharp edges and also even just kind of squished down a 93 00:06:08,660 --> 00:06:09,330 little bit. 94 00:06:09,350 --> 00:06:10,900 We need to fix that. 95 00:06:10,910 --> 00:06:12,320 There are different ways to fix this. 96 00:06:12,320 --> 00:06:16,940 We can come down here and say fit scaled to fit like this. 97 00:06:17,030 --> 00:06:20,140 You save and run. 98 00:06:20,240 --> 00:06:20,810 Look at that. 99 00:06:20,810 --> 00:06:24,440 It went ahead and actually made it look much better. 100 00:06:24,440 --> 00:06:29,830 It's scaled to fit as such in fact I can come down here and comment this out. 101 00:06:29,840 --> 00:06:32,900 Let's save this. 102 00:06:32,960 --> 00:06:38,060 You see now things change a little bit but at least it works fine so we can still use scale to fit. 103 00:06:38,060 --> 00:06:42,830 And of course past the frame as we did before notice the frame is going to constrain everything. 104 00:06:42,830 --> 00:06:47,450 But if you want to make sure that the system scales everything to fit you we can just remove the frame 105 00:06:47,720 --> 00:06:49,480 and things still work. 106 00:06:49,970 --> 00:06:51,690 Now you can see the image and that squish now. 107 00:06:51,800 --> 00:06:54,110 He looks perfectly very good. 108 00:06:54,110 --> 00:06:59,120 The next thing we're gonna do is we're gonna go ahead and add some sort of like a circle around to make 109 00:06:59,120 --> 00:07:00,380 it even nicer. 110 00:07:00,380 --> 00:07:03,130 Now we could do that with patterns and go all over the place. 111 00:07:03,290 --> 00:07:08,060 But again with Swift we can do that by using a dot clip shape like that. 112 00:07:08,060 --> 00:07:12,170 And inside we have to pass another type which is a shape. 113 00:07:12,170 --> 00:07:14,950 What are we gonna pass here is just a circle. 114 00:07:15,000 --> 00:07:16,360 It's a circle like that. 115 00:07:17,030 --> 00:07:21,020 And this circle here is an object of course like that. 116 00:07:21,080 --> 00:07:23,970 Let's go ahead and save this and run. 117 00:07:24,010 --> 00:07:30,610 Well I just like that you can see now we have a nice circle because we said the one could clip around 118 00:07:30,910 --> 00:07:33,460 in passing the circle so it looks like this. 119 00:07:33,460 --> 00:07:34,660 Very very handy. 120 00:07:34,990 --> 00:07:35,890 Now check this out. 121 00:07:35,890 --> 00:07:37,120 There's other things we can do. 122 00:07:37,120 --> 00:07:42,390 I can say well I want to actually to add maybe a nice overlay circle here. 123 00:07:42,400 --> 00:07:44,190 That kind of makes this image Pop. 124 00:07:44,530 --> 00:07:44,970 All right. 125 00:07:45,110 --> 00:07:52,300 So we can come down here as a dot overlay like that and overlay again requires a view and this view 126 00:07:52,300 --> 00:07:55,060 is going to be type circle again. 127 00:07:55,120 --> 00:07:58,480 But now this circle here will have to get other things right. 128 00:07:58,480 --> 00:08:04,840 So inside of the circle I'm gonna go ahead and say dot to pass stroke like this. 129 00:08:04,840 --> 00:08:10,910 And for our stroke I need to pass the color of the strokes on as a color. 130 00:08:11,110 --> 00:08:14,560 I'm gonna make it white and line width right. 131 00:08:14,560 --> 00:08:22,960 How wide is this circle around it going to be just gonna see about three save and run and just like 132 00:08:22,960 --> 00:08:26,250 that I can see that very nice line there. 133 00:08:26,440 --> 00:08:27,710 Very good. 134 00:08:27,790 --> 00:08:33,540 And if I decided well you know what I want to add some shadow radius for that I'd Why do I say that 135 00:08:33,550 --> 00:08:37,690 dot shadow radius just like we saw before. 136 00:08:37,720 --> 00:08:45,760 Let me pass something like six run again and just like that you can see there's this nice shadow around 137 00:08:45,760 --> 00:08:49,330 it which makes it more professional and looks really good. 138 00:08:49,360 --> 00:08:51,070 All right very good. 139 00:08:51,070 --> 00:08:56,330 And just like that we have a symbol out but at least you can see the power in the features of suit do 140 00:08:56,340 --> 00:08:56,680 I. 141 00:08:56,800 --> 00:08:58,390 And how declarative it is. 142 00:08:58,390 --> 00:08:58,700 Right. 143 00:08:58,720 --> 00:09:03,430 Because we declaring on what we want to see shown in our view in code. 144 00:09:03,680 --> 00:09:03,880 Right. 145 00:09:03,880 --> 00:09:08,860 So we create the H stack and we create an image as a side that is inside of each stack. 146 00:09:08,860 --> 00:09:12,730 So anything else that is inside of V stack is gonna be vertically aligned. 147 00:09:12,730 --> 00:09:19,300 So we have name Twitter account and the web address and all of that's going to be to the right because 148 00:09:19,330 --> 00:09:23,170 it's inside again of H stack and we added that image. 149 00:09:23,170 --> 00:09:28,690 So it goes and controls everything and put everything in place and just like that we have our base card 150 00:09:29,020 --> 00:09:29,320 app.