I have been searching for a way to make a menu come 80 pixels down from the top of the screen and have the screen slide down with it (80 pixels) when the user swipes his finger from top to bottom (and reverse it when they swipe top to bottom to send it back up). How should i go about doing that? Anything helps. Thank you!
Share
Create a UISwipeGestureRecognizer and add it to the view you want it to appear on:
Create an instance variable that will hold your menu view and add it to the view OUTSIDE of the screen (note -80 y-coordinate):
Define a method that will slide the menu onto the view when down swipe is detected:
If you want the screen to slide down with it or anything else you might like to happen, add additional actions to the animation block.
To remove the view with the upward slide, you can create another UISwipeGestureRecognizer, but with
UISwipeGestureRecognizerDirectionUpdirection. Make another method that will do a reverse-slide of the menu.Hope it helps.