iOS custom gesture + sidebar - ios

I'd like to implement a sidebar that is revealed/hidden with a custom gesture.
Sidebar - A small window that appears either on the left or right. It shouldn't be huge, but big enough to encompass a few buttons and maybe some text.
Custom Gesture - I want a swipe to reveal/hide the sidebar very similar to what is done with the notification center in iOS 5. With the notification center, you place your finger at the top and swipe down. I'd like a similar gesture. So if the user has his/her finger to the left of the screen and swipes his/her finger onto the screen, then reveal the sidebar on the left. To hide it, just do the reverse gesture. Ditto for showing the sidebar on the right.

Related

Add gesture recognizer to allow horizontal swipes on a MapView in Swift

I'm working on an app that uses a snapchat style navigation system where the user can swipe horizontally between view controllers. The problem is that one of the view controllers is a map and once the user scrolls to the map, they can't scroll back because the map interprets all gestures as being map related. How could I implement a horizontal swipe gesture control that would allow the user to swipe horizontally (from right to left) to get out of the map view controller?
The solution to this is to add edge to edge gesture recognizers overlaid over the map view. These recognizers would span the vertical and horizontal edges of the view and when the user swipes from the extreme edges of the screen, the snapchat navigation system would be toggled

iOS Sidebar UIPanGestureRecognizer - Sliding Centre View Between coordinates

I've been trying to work this one out based on a tutorial I've been following from Ray Wenderlich's tutorials.
https://www.raywenderlich.com/32054/how-to-create-a-slide-out-navigation-like-facebook-and-path
I only want my nav bar to have a left sided slide menu (I don't need the right sided menu that is in the example)
When I am using the gestures to swipe I can't find a good way to stop the view from going any further to the right than the position I want it set to when the menu is open (100pts from the right). When I swipe it back into position I don't want the view to swipe any further than 0 (I don't want it's x value to be negative).
With the current Facebook iOS App (55.0 - 12 May 2016) there is a side menu for chat. That's the exact functionality I am after (but on the left side instead of right).

Swipe gesture not working on UIPageViewController when button clicked

I have created a UIPageViewController which I present on the screen.
The page view consists of 4 views. On top of each view I have added a UIButton over the top of the whole view to detect when someone clicks on a view.
Here is the view in interface builder. The whole of each coloured view has a button covering it:
When the user swipes I want the page view controller to go from one screen to the next.
Problem
When I go to make a swipe gesture, if I touch a button then it picks up the tap gesture for that button. So if I continue to slide my finger across the screen the page gesture doesn't work.
Goal
Even when I tap on a UIButton, if I don't lift my finger but instead make a swipe gesture, then I would like the UIPageViewController to turn page.
How can I override the touch gesture and instead make the slide gesture count and thus turn the page of the UIPageViewController.
Help much appreciated.

Disable/alter behavior of "swipe from left" on iPad with master/detail configuration

I have a master/detail split view configuration in my iPad application. If I swipe from the left (or really, just swipe to the right in the detail view, regardless of whether I start at the left edge of the screen or not) it slides open the master view.
The issue here is that my detail view is an MKMapView, so if I put my finger on the map and move my finger to the right (to pan left) the master view opens! I have to start dragging my finger in some other direction, and then go right, to properly pan.
Can this behavior be altered either:
So it is disabled completely (only allowing opening the master view from the back button)
So it only affects swipes in the detail view that are not over the map
So it only triggers if the swipe starts from the edge of the screen
Thanks!
Yes, you can disable that behavior. Set the presentsWithGesture property of the split view controller to NO to disable the swiping gesture.
Isn't this what the IsGestureEnabled setting is for on the MasterDetailPage?

Use iOS 7 swipe from left border in Navigation without Top Bar

I am currently working on an app that has two or more views and I want to swipe around between them. Right now I'm using a Navigation Controller.
Unfortunately if I use push to swipe to another view the transition is always from right to left. It used to be a problem that the swipe from left to right transition was not available.
With iOS 7 the transition from left to right (back) is working out of the box but the swipe gesture only works if you have the "Top Bar" activated.
Is there a way to keep the animation for my left to right swipe without displaying the top bar with the back button?
Just figured it out my self. You can simply enable the Top Bar and check "Hidden". Now the swipe back works with the right animation and there is still no Bar.

Resources