SWRevealViewController Pan gesture is not working when the from view is scrolling enabled - swift

I have a side menu which is impelemented by SWRevealViewController and my frontView has a collection view.
SWReveal works fine by tap on menu button, but the pen gesture is not working on collection view (which has a horizontal scrolling enabled).
can any one help me to force collection view to accept the pen gesture of the SWReveal?

SWRevealViewController's gesture controller and collection view are been clashing that's why the problem occurs. Other than that as per my view there is no practical way to identify what user wants to open by the gesture.
But Client needs a solution and the image shows it! keep user interaction ON of the view.
Let me know if you find anything else.
Best of luck.

Add below code in viewDidLoad
self.view.addGestureRecognizer(revealViewController().panGestureRecognizer())

Related

Avoiding touch gesture conflicts between two different views

Let me emphasize that there are two views that overlap and I want handle the touch gestures of the view on top.
The UIGestureRecognizeDelegate methods work for conflicting gestures within one view not two views from what I have read. Please don't link me to those threads without explaining.
This issue is occurring between the toolbar items and an image view with gestures attached to it.
In the image above the bar buttons cannot be touched.
Other apps handle this case without issues. If I touch a bar button it would work and if I drag the view on the non-overlapped parts I would be able to drag it.
How can I achieve this ?
Currently the image view has gestures attached to it (one for testing, its a pan).
Update
As requested here is a Gif.
Notice how the buttons are not responding when there is a view under the toolbar.
The issue was that I was using view.layer.zPosition, apparently changing the zPosition does not change the position of view is the subview hierarchy (which was something that I assumed).
Source: https://stackoverflow.com/a/15807250/3366784

How to tell VoiceOver that a control has animated away?

User taps control and a different view comes up, animated. VoiceOver still highlights the removed control and it is stuck. User can't interact with the view.
This is not in a UIViewController but a custom UIView subclass.
How to tell VoiceOver to update its presentation or state when something appeared or disappeared with animation?
You can post an accessibility notification to indicate that the layout or the full screen of content has changed and select a new element.
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification
elementToSelect);

Disable all superviews except a specific view

I have UIView that open with a UIButton click. I want to disable user interaction of all other superviews except to this specific view and his subviews, how can I do that? Just to make this view the only view that will response to user touch.
Thanks!
Agree with the comment, you probably want to disable all siblings of a view... (edited so you can set them back to enabled at some point)
- (void)setSiblings:(UIView *)view enabled:(BOOL)enabled {
for (UIView *sibling in view.superview.subviews) {
if (sibling != view) sibling.userInteractionEnabled = enabled;
}
}
I know you already accepted an answer but a better (and easier) approach is to display the new view full screen. Make the new view with a clear background. Then add the real view as a subview to this full screen view. This way you don't have to mess with any existing views to display this new view. You can still see everything behind it but touch events are blocked by the clear, fullscreen view.
Then when you remove this full screen view (fade out animation?) you don't have to mess with all the existing views again.
You shouldn't have to modify existing views just to display another. And what happens if one of those existing views really should have its interaction disabled? You will end up enabling the interaction when you dismiss your "modal" view.

iPhone4 how to add/animate a UIView to appear under a UIButton?

I have a "side panel" like widget in my app that can be swiped in from the side of the screen. In order to help the users find the panel, I also added a UIButton to do the same thing - scroll the panel on and off screen.
The view comes from a different view controller, otherwise I would've simply created an extra panel in the interface builder and positioned it properly.
My problem is that the side panel gets positioned over the button, so if it is displayed with a button, it can only be dismissed with a gesture.
is it possible to specify at which "depth" I add a UIView when I programmatically add it in code?
This is the snipped that slides the panel in or out within the animation block.
self.audioSystemController.view.frame =CGRectMake(0,20, 120,460);
I need the UIView to be shown below a UIButton, so the button may be used to dismiss the view. I know this is redundant, but I cannot depend on the users to simply discover the side swiping gestures :/
Thank you for your help!
Check out the insertSubview:belowSubview: method of UIView.

How to put UIGestureRecognizer in front if several views with gestures overlaps

I have two views that have tap gesture recognizers attached. The first view accepts touches while the second one is hidden. After some time, I'm making the second (with attached gesture) view visible. The problem is that, still, only the touches of the first view are handled, despite the second view is in front :(
Sorry, forgot to put "user interaction enabled". I'm drawing my views and other stuff with interface builder, therefore I have missed that :)