Come back in this lesson I will show you how to use a busy pad inside of you.
I was going to show you a different way of initialising that you have you that is not with the frame.
So let's get into school and I'm going to start a new application called Is it a linear because with
how busy a pad chair in the next lesson essentially.
So in my view controller here longer than do I don't want to have anything in there for they do want
to have a one hour another class and you could simply have this in a separate class if you wish to.
Or you could have it right in here as well.
I think it did an extra curly bracket.
That's OK.
So I say class and this class is just like the last thing I'm going to be or drawing you view.
And it's a subclass of you I view of course and the only function I want to overwrite is draw something
I say draw a draw.
What do some things so let's go ahead and say let's just call it the path that would become a you I.
Busy a path and then every path needs to have a vet.
So I'm going to say path dot vet.
Let's make it five.
For instance you could also decide about things such as the cap has died.
Like that's the ending the two ends of the line.
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
square.
I want to use a round one for instance and then I'm going to go ahead and decide about the color of
it which is a little different than what you would usually do you would say eye color dot for instance
red dot the set Astro.
So that's the Astro quality that is coming up.
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
to that's the starting point of throwing the curve.
I'm going to say C.G. point is places that are anywhere such as the beginning.
Let's why don't we draw a rectangle.
I'm going to say let's put that 50 and 50.
That's a good number that's easier for me to remember.
I'm going to say Dodd the line and the line I want to add is going to be our son.
Let's first make the first horizontal line which is going to be let's say two hundred and fifty and
I think one line is enough we can actually see it already so Pat has dodged the stroke.
Now the question becomes this how are we going to use this draw view.
Because I didn't overwrite the in it with frame and we don't have the any code.
So what they could do is they could just go to my main storyboard I could add a few eye view.
And the reason I chose to make it like this is because I want you to see another way as well.
So I wanted you to know that there are other ways of calling them as well.
So this you I view in here which I'm going to give it a light gray background color.
I'm going to go here and classes and say he is of the type the wrong view.
So on the fly as the app gets loaded.
This view is going to this outlet is going to go with this file and redraw itself.
Let's see if that actually happens.
I'm going to run the application and if it all works we should see obviously the light gray background
color as well as one line that goes between 50 50 to 200 and 50 and that's exactly the way you went
hoping it's going to happen.
So now with a few more lines I'm going to say next line is one hundred and fifty for the next one is
going to be 200 maybe 300.
And then I'm going to add another one if I'm trying to make a square.
So that is 50 50 on the lower left corner.
This is 200 I'm 50.
If you come down here is two hundred and three hundred.
The next one has to be 50 and 300.
If I copy and pasted it one more time.
The last one is going to be back to 50 50.
Why don't I make this 50 and a hundred.
So we don't we see a little opening in here.
So let's go ahead and rewrite and that's it.
Simply drawing curves using you a busy spot as well as calling a draw of a view.
The interface builder.
Not true the code as you can see my view control doesn't have any body essentially.
And this is a very useful way for drawing different curves and a stuff in the next lesson.
I'm going to show you how to draw the same curve but this time a busy H.F. that also has controls and
those controllers they help us change the curvature of each of the curves and also I'm going to add
a touches moved the metal on top of everything.
So let's move on to the.