1
00:00:02,310 --> 00:00:08,210
Come back in this lesson I will show you how to use a busy pad inside of you.

2
00:00:08,250 --> 00:00:14,150
I was going to show you a different way of initialising that you have you that is not with the frame.

3
00:00:14,280 --> 00:00:23,500
So let's get into school and I'm going to start a new application called Is it a linear because with

4
00:00:23,520 --> 00:00:27,590
how busy a pad chair in the next lesson essentially.

5
00:00:27,840 --> 00:00:33,960
So in my view controller here longer than do I don't want to have anything in there for they do want

6
00:00:33,960 --> 00:00:39,250
to have a one hour another class and you could simply have this in a separate class if you wish to.

7
00:00:39,390 --> 00:00:41,710
Or you could have it right in here as well.

8
00:00:41,730 --> 00:00:44,640
I think it did an extra curly bracket.

9
00:00:44,640 --> 00:00:45,390
That's OK.

10
00:00:45,550 --> 00:00:51,730
So I say class and this class is just like the last thing I'm going to be or drawing you view.

11
00:00:51,880 --> 00:00:58,940
And it's a subclass of you I view of course and the only function I want to overwrite is draw something

12
00:00:58,940 --> 00:01:00,820
I say draw a draw.

13
00:01:00,830 --> 00:01:08,230
What do some things so let's go ahead and say let's just call it the path that would become a you I.

14
00:01:08,280 --> 00:01:13,790
Busy a path and then every path needs to have a vet.

15
00:01:13,800 --> 00:01:17,640
So I'm going to say path dot vet.

16
00:01:17,820 --> 00:01:19,490
Let's make it five.

17
00:01:19,500 --> 00:01:24,610
For instance you could also decide about things such as the cap has died.

18
00:01:24,660 --> 00:01:27,820
Like that's the ending the two ends of the line.

19
00:01:27,900 --> 00:01:39,150
So I'm going to say pads doth capice style is going to be a C.G. line chapt dot and we have around a

20
00:01:39,150 --> 00:01:40,000
square.

21
00:01:40,170 --> 00:01:45,420
I want to use a round one for instance and then I'm going to go ahead and decide about the color of

22
00:01:45,420 --> 00:01:51,540
it which is a little different than what you would usually do you would say eye color dot for instance

23
00:01:51,550 --> 00:01:54,660
red dot the set Astro.

24
00:01:54,900 --> 00:01:58,380
So that's the Astro quality that is coming up.

25
00:01:58,440 --> 00:02:06,770
So then I'm going to go ahead and I start drawing my chair if I'm going to say path dot move to move

26
00:02:06,900 --> 00:02:10,580
to that's the starting point of throwing the curve.

27
00:02:10,630 --> 00:02:16,870
I'm going to say C.G. point is places that are anywhere such as the beginning.

28
00:02:17,070 --> 00:02:19,960
Let's why don't we draw a rectangle.

29
00:02:19,980 --> 00:02:23,610
I'm going to say let's put that 50 and 50.

30
00:02:23,700 --> 00:02:26,990
That's a good number that's easier for me to remember.

31
00:02:27,060 --> 00:02:33,850
I'm going to say Dodd the line and the line I want to add is going to be our son.

32
00:02:33,960 --> 00:02:42,360
Let's first make the first horizontal line which is going to be let's say two hundred and fifty and

33
00:02:42,510 --> 00:02:51,480
I think one line is enough we can actually see it already so Pat has dodged the stroke.

34
00:02:51,480 --> 00:02:56,240
Now the question becomes this how are we going to use this draw view.

35
00:02:56,250 --> 00:03:02,890
Because I didn't overwrite the in it with frame and we don't have the any code.

36
00:03:03,060 --> 00:03:09,470
So what they could do is they could just go to my main storyboard I could add a few eye view.

37
00:03:09,770 --> 00:03:15,410
And the reason I chose to make it like this is because I want you to see another way as well.

38
00:03:15,440 --> 00:03:20,020
So I wanted you to know that there are other ways of calling them as well.

39
00:03:20,180 --> 00:03:25,690
So this you I view in here which I'm going to give it a light gray background color.

40
00:03:25,880 --> 00:03:31,020
I'm going to go here and classes and say he is of the type the wrong view.

41
00:03:31,190 --> 00:03:35,030
So on the fly as the app gets loaded.

42
00:03:35,120 --> 00:03:42,190
This view is going to this outlet is going to go with this file and redraw itself.

43
00:03:42,200 --> 00:03:43,700
Let's see if that actually happens.

44
00:03:43,700 --> 00:03:49,580
I'm going to run the application and if it all works we should see obviously the light gray background

45
00:03:49,580 --> 00:03:59,270
color as well as one line that goes between 50 50 to 200 and 50 and that's exactly the way you went

46
00:03:59,330 --> 00:04:00,670
hoping it's going to happen.

47
00:04:00,830 --> 00:04:09,530
So now with a few more lines I'm going to say next line is one hundred and fifty for the next one is

48
00:04:09,530 --> 00:04:14,060
going to be 200 maybe 300.

49
00:04:14,300 --> 00:04:17,570
And then I'm going to add another one if I'm trying to make a square.

50
00:04:17,570 --> 00:04:21,450
So that is 50 50 on the lower left corner.

51
00:04:21,500 --> 00:04:23,870
This is 200 I'm 50.

52
00:04:23,870 --> 00:04:26,800
If you come down here is two hundred and three hundred.

53
00:04:26,810 --> 00:04:30,700
The next one has to be 50 and 300.

54
00:04:31,340 --> 00:04:33,790
If I copy and pasted it one more time.

55
00:04:33,830 --> 00:04:38,260
The last one is going to be back to 50 50.

56
00:04:38,330 --> 00:04:40,730
Why don't I make this 50 and a hundred.

57
00:04:40,730 --> 00:04:43,760
So we don't we see a little opening in here.

58
00:04:44,000 --> 00:04:48,400
So let's go ahead and rewrite and that's it.

59
00:04:48,400 --> 00:04:56,840
Simply drawing curves using you a busy spot as well as calling a draw of a view.

60
00:04:57,000 --> 00:04:58,310
The interface builder.

61
00:04:58,360 --> 00:05:04,720
Not true the code as you can see my view control doesn't have any body essentially.

62
00:05:04,800 --> 00:05:10,310
And this is a very useful way for drawing different curves and a stuff in the next lesson.

63
00:05:10,320 --> 00:05:17,770
I'm going to show you how to draw the same curve but this time a busy H.F. that also has controls and

64
00:05:17,770 --> 00:05:23,800
those controllers they help us change the curvature of each of the curves and also I'm going to add

65
00:05:23,860 --> 00:05:28,410
a touches moved the metal on top of everything.

66
00:05:28,450 --> 00:05:30,040
So let's move on to the.
