Swipe gesture not working on UIPageViewController when button clicked - ios

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.

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

Run action when any screen interaction ends on a uibutton

At the moment I have 4 uiviews acting like a menu with another uiview above it acting as the menu reveal button which requires a long press to show the 4 uiviews. A user needs to long press on a uiview to show the uibuttons (menu) and then they would slide down over one of the uiview and then release the press. How can I tell which uiview the slide ended on.
Similar to how the 3D touch menus work.

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?

After hiding navbar, touches aren't recognized where the navbar was

I have a UIPageViewController which has a root view controller and a data view controller (the xcode template).
I have two tap gesture recognizers on the main view in the data view controller.
I have an image view embedded in a scroll view which is embedded in the main view.
A single tap hides the navbar and a double tap zooms the image. I am unable to use either gesture recognizer where the navbar was after it is hidden.
Is there a way to enable the gesture recognizers in this space when the navbar is hidden or did I just miss a step?
It's like the root view controller has blocked that area out; the gesture recognizers work perfectly everywhere else. I can post code if needed.

iOS custom gesture + sidebar

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.

Resources