John-Lluch / SWRevealViewController

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !
Other
4.52k stars 989 forks source link

Pan gesture isn't working properly. #649

Open AashishSapkota opened 7 years ago

AashishSapkota commented 7 years ago

Without adding pan gesture to 'front' ViewController, gesture gets activated after once toggling the rear view. (and works properly every time, after a tap on the 'rear' view toggle button.) & Adding pan gesture to 'front' ViewController, misplaces 'rear' ViewController margins. (and again works properly after a tap on the 'rear' view toggle button.)

Can someone please help..:)

iDevelopper commented 7 years ago

Try this. When you add the constraints to your rear view, uncheck Constrain to margins:

2016-11-28_10-19-34

AashishSapkota commented 7 years ago

Yeah, I checked out constraints. But, I'm getting an error for only 'panGesture' until the sideBar button is tapped. Even 'panGesture' is working correctly, but only after a button is clicked.

Screenshot before the button is tapped for sideMenu;

screen shot 2016-11-30 at 3 38 34 pm

Screenshot after the button is tapped for sideMenu;

screen shot 2016-11-30 at 1 03 14 pm
iDevelopper commented 7 years ago

What kind of object is the top view in rear view. A navigation bar?

AashishSapkota commented 7 years ago

Hey thanks @iDevelopper, but I'm not getting you, coz i'm having problem with SWRevealView and I haven't used PBRevealView. Its just a UIView as top view in rear view.

I couldn't even run your project, coz i'm with xcode-7.

AashishSapkota commented 7 years ago

Are you suggesting to change my SlideMenu library??

iDevelopper commented 7 years ago

No, but I can't resolve this issue. You could also embed your rear view in a navigation controller for replacing your view.

iDevelopper commented 7 years ago

I finally got it. Check yours constraints again. It works.

2016-12-02_09-26-22

iDevelopper commented 7 years ago

SWLayoutXc7.zip

AashishSapkota commented 7 years ago

I have two conditions here;

iDevelopper commented 7 years ago

Have you looked at my example? it works.

AashishSapkota commented 7 years ago

Yeah I've looked into your project @iDevelopper. But, even I'm not getting error while testing it in a new or a separate project. This project has already been built and its like 'ready for the release', so I'm searching for 'What could be the reason behind the issue?'.. so I could solve it with a better way. Isn't there any way to solve the above issue in a healthier way, maybe. You have been trying to help me out with your valuable time, really appreciate that :-)

iDevelopper commented 7 years ago

This example was meant to show you that your constraints were not good. So you really have to look around for that.

AashishSapkota commented 7 years ago

If the constraints weren't correct than how would it be possible to work properly after a single tap gesture?? Why would it change its position?

Plus Have you seen those conditions I mentioned you in above comment??

iDevelopper commented 7 years ago

You can see that my sample works. But I had to go through it several times. It seems that this is a problem in Xcode. Try to put your constraints as you think and then modify them by editing them. Look at the constraints in my sample, and try to find somme differences.

AashishSapkota commented 7 years ago

I tried editing it with all your constraints, still facing the same problem. :(

iDevelopper commented 7 years ago

Is it possible for you to share a copy of your project with just the menu and the first front view controller (a light version)?