Solar come back this is going to be a very simple one.
It is a way for us to make you own gestures inside our code rather than doing them in Interface Builder.
And there are a lot of reasons why you want to do that simply because in a lot of situations you don't
know what your objects are going to be.
Let's say you want to have so many you swipe gestures attached to cells of a table view for instance
you don't know that how many cells are going to be and you don't really have access to those.
So it really makes sense that you do these kind of things in the code that not only makes sense.
It's kind of the only way.
So that's going to exclude.
And I'm going to add a new app called just Shearer's forth.
And like I said it's going to be very simple because we have seen all of this before.
I a year I'm going to go ahead and say in my view that lot for instance or any one else I have let this
small Let's make this one a long one my long gesture.
Not long long just that's going to be a while longer press just should recognizer.
And they always have to follow these tools simply because that is from the you I just sure recognize
the parent class of all of them.
Target is up and the selector is going to have an action just yet.
So I'm going to say function it just shows function no parameters and no return type obviously or from
now.
So does that just shows function which means every time a long press is detected it's going to go run
this function.
Of course I forgot to add the Objective-C exposure.
Now that part is taken care of.
Now what we have to do the very last thing in here essentially is adding this just shift to someone
your view or your cell of your table view the block on your game or whatever you're trying to do.
So for now I'm going to say self don't view and just show recognizers my long gesture and that's about
that.
Now you have made a gesture recognizer inside the body of your court course if you wanted to do it actually
add something in here save Prince lawing press.
That's about that.
I'm going to run the court and now that this simulator is up if I going yeah and say I hold the ball
then boom.
Long pressed.
So that's about it.
Very simple very simple lesson.
Adding a just sure that is inside the court and you add them on your different objects.
If for instance you had a lead red box being a you or you view if you had not then you could say red
box does that or whatever is the object that you want to use it on.
So we'll push just find yourself that view.
And I don't need that for now.
So that's about that.
And I see you in the next lesson.