Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue 204: center view gets truncated if user holds finger on the screen during the device rotation. #222

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions MMDrawerController/MMDrawerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,10 @@ -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfac

-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
if (self.animatingDrawer)
{
self.startingPanRect = self.centerContainerView.frame;
}
for(UIViewController * childViewController in self.childViewControllers){
[childViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation];
}
Expand Down Expand Up @@ -957,6 +961,7 @@ -(void)panGestureCallback:(UIPanGestureRecognizer *)panGesture{
}
else {
self.startingPanRect = self.centerContainerView.frame;
self.animatingDrawer = YES;
}
}
case UIGestureRecognizerStateChanged:{
Expand Down Expand Up @@ -1000,6 +1005,7 @@ -(void)panGestureCallback:(UIPanGestureRecognizer *)panGesture{
}
case UIGestureRecognizerStateEnded:{
self.startingPanRect = CGRectNull;
self.animatingDrawer = NO;
CGPoint velocity = [panGesture velocityInView:self.childControllerContainerView];
[self finishAnimationForPanGestureWithXVelocity:velocity.x completion:^(BOOL finished) {
if(self.gestureCompletion){
Expand All @@ -1010,6 +1016,7 @@ -(void)panGestureCallback:(UIPanGestureRecognizer *)panGesture{
}
case UIGestureRecognizerStateCancelled:{
[panGesture setEnabled:YES];
self.animatingDrawer = NO;
break;
}
default:
Expand Down