Add property to allow configuration of the velocity threshold used to de... #83

Merged
merged 1 commit into from Sep 12, 2013

Projects

None yet

3 participants

...termine whether to open left/right in response to pan gesture.

We have found that, in our project, we need to set this property to zero. If left at the default of 100, there is a race condition when using the pan gesture to close an exposed under controller. When panning very slowly (e.g. abs(currentVelocityX) < 100 ) to close the left or right under controller, it was possible to cause a reset of the top view (e.g. remove under controller's views from the view hierarchy), immediately followed by an open of the under controller whose view was just removed. So, despite having a non-nil under controller, the side would be opened to a blank white screen.

Removing the 100 points/second buffer in the currentVelocityX check eliminates the race condition, but I'm sure that velocity check is there for a reason. As such, I've opted to add a property with the default value being 100, that I can set to zero in my projects to avoid the race condition described above.

Jeff Arena Add property to allow configuration of the velocity threshold used to…
… determine whether to open left/right in response to pan gesture.
e871755
SFPink commented Feb 7, 2013

This can happen when calling [self.slidingViewController anchorTopViewTo:ECRight]; on a button touch. When its spammed the under controller can be a blank white screen. Would this be a similar fix?

@SFPink I'm not sure if this would address your issue when calling anchorTopViewTo: in response to button touches. The specific race condition I've observed was only occurring during panning.

@enriquez enriquez merged commit 52f5820 into ECSlidingViewController:master Sep 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment