Apologies
You must be signed in to watch this lesson.
Drag and Drop UIPanGesture Recognizer Pt.1
Podcasts
Introducing more UI interaction for your app will always make it feel more alive. However it does come at a cost of heavy development work. This is especially the case when it comes to including draggable behavior that also animates views around the screen. Luckily, UIPanGestureRecognizer is a relatively simple class to use once you are familiar with how touches are recognized. Let's dig into how to keep track of our y value positions so we can get the dragging behavior working perfectly.

Comments (3)
SimonQ
5 years ago
What's the reason for using self.superview in getting the translation values? I used self and that worked as well? The superview being the main tab bar controller because that's where we setup the player detail view correct? Also, in some apps I noticed that when it reaches a certain height, it snaps in that direction (i.e. if it is more than half way up it goes all the way to the the top, vice versa at the bottom). Would this be easy to implement? I would assume we'd take into account the devices center y and if it goes beyond either direction we can just call the maximize or minimize methods to reduce redundancy as well.
SimonQ
5 years ago
Ah second part is answered in next video
Brian Voong
5 years ago
Maxnelson997
5 years ago
Wow so simple & effective.
shender ramos
4 years ago
omg this is so easy.. i saw this function on most media apps such as youtube music apple music Spotify etc and i though it was way harder.. for features like this is that i'm always saying paying for your courses is well worth.. keep it up man... thanks
HELP & SUPPORT