Apologies
You must be signed in to watch this lesson.
Player Dismissal on Drag
Podcasts
The final phase of our drag and drop player feature is to implement dismissal on drag when in maximized mode. One very simple technique for this behavior is to implement another simple UIPanGestureRecognizer that will help us track the y translation position of our fingers. Enjoy.

Comments (5)
zcrystal
6 years ago
Great vids today, Brian! :)
Tube
6 years ago
Lesson numbering errors. Beginning around Lesson 20+ there are lesson numbering inconsistencies. For example, according to the main page this is Lesson 25. yet the next lesson shows as Lesson 25.
Tube
6 years ago
Nevermind. When I posted this, it corrected itself Browser reload issue I guess.
Brian Voong
6 years ago
guleadrian
6 years ago
I don't mind receiving emails every day, if there is a way to opt-in and -out.
abhinavjayanthy
5 years ago
Hi Brian, I love the video course, I have a small question, I'm trying to include the airplay picker using the AVRoutePickerView. As per the apple documentation and what I understand we have to create a wrapper view and have the picker be placed in the view. I could achieve most of it but once I pick a output of the audio, the PlayerDetialsView has UI issues ( I wish I could upload a picture here). for some reason I have the tab bar below showing up from then on, the volume slider and the airplay picker both are below this tab bar . How can i work around this issue.Thanks in advance.
abhinavjayanthy
5 years ago
I've added this new wrapper view to the mainStackView using the addArrangedSubview method
Brian Voong
5 years ago
abhinavjayanthy
5 years ago
Sure,here you go https://imgur.com/a/E6l22
abhinavjayanthy
5 years ago
The second image and the third are after I click the output of the audio, as you can see in the first pic, before I select the output, it looks perfectly fine
abhinavjayanthy
5 years ago
Hey Brain, I was just checking if you are able to reproduce what I’m encountering.
xuano
5 years ago
Hi Brian, Just a minor detail that I realized and I think it makes the dismissal pan gesture nicer. When we change the transform in the handleDismissalPan method, I used the PlayerDetailsView transform property directly, not the transform on the maximizedStackView. That way, as you drag, you can see the list with all the episodes behind, and somehow, the animation feels more natural (I checked this using the slow animations option in the simulator). Thanks for these great courses ;)
Brian Voong
5 years ago
Tube
5 years ago
Good tip, xuano!
TWei
4 years ago
For mainTabBarController, I'm using a getter like so: var mainTabBarController: MainTabBarController? { return UIApplication.shared.keyWindow?.rootViewController as? MainTabBarController }
HELP & SUPPORT