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

UIPanGestureRecognizer only returns state Began and Cancelled when I put ModalViewController in an UINavigationController #3

Open
thaiduy opened this issue Jul 26, 2016 · 1 comment

Comments

@thaiduy
Copy link

thaiduy commented Jul 26, 2016

  1. In your example, you're presenting ModalViewController as following flow in storyboard:
    ViewController --(present modally segue)--> ModalViewController
  2. In my case, I need to present ModalViewController in a UINavigationController, so i set up my storyboard as following flow:
    ViewController --(present modally segue)--> UINavigationController --(relationship root view controller)--> ModalViewController

In case (1), panGestureRecognizer will return all available states: Began, Changed, Cancelled, Ended. But in case (2), it will only return Began and Cancelled. Do you have any idea why it happened and how to fix it?

Thank you!

@thaiduy
Copy link
Author

thaiduy commented Jul 26, 2016

Finally I make it working by setting UINavigationController's transitioningDelegate to ViewController

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    UINavigationController *nav = segue.destinationViewController;
    if (nav && [nav isKindOfClass:[UINavigationController class]]) {
        ModalViewController *desVC = nav.viewControllers[0];
        nav.transitioningDelegate = self;
        [desVC setInteractor:_interactor];
    }
}

But when I drag the ModalViewController around without completely dismissing it for some times, the UI get frozen, no logs, no errors message, nothing on the console window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant