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

animationDidStop delegate callback checks for finished #104

Open
cooksimo opened this issue May 13, 2016 · 3 comments
Open

animationDidStop delegate callback checks for finished #104

cooksimo opened this issue May 13, 2016 · 3 comments

Comments

@cooksimo
Copy link

- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)finished {
    BOOL presenting = [[anim valueForKey:@"presenting"] boolValue];

    if (presenting && finished) {
        if ([_delegate respondsToSelector:@selector(calloutViewDidAppear:)])
            [_delegate calloutViewDidAppear:(id)self];
    }
    else if (!presenting && finished) {

        [self removeFromParent];
        [self.layer removeAnimationForKey:@"dismiss"];

        if ([_delegate respondsToSelector:@selector(calloutViewDidDisappear:)])
            [_delegate calloutViewDidDisappear:(id)self];
    }
}

This delegate callback checks for finished, I don't think it should. Our use case is we are changing the callout visible on the map when the map isn't the frontmost view on the screen, when this happens iOS is optimizing the animation and calling this delegate with finished NO. This means the previous callout is never removed from the parent and will intercept any subsequent touches.

@davidganster
Copy link

I just ran into the same issue on an iPad, with a modal view controller on top of the map.
Also, but perhaps unrelated, the callout takes a very long time (>1sec) to be presented after a modal view controller was shown.

@nfarina
Copy link
Owner

nfarina commented May 17, 2016

So this flag was added in aca4f1a to fix issue #64. Is there a simple solution that would resolve both issues?

@cooksimo
Copy link
Author

Not sure what the actual issue is in #64 - we've been running without the check for finished for a while now and haven't had any issues.

vipuldelwadia pushed a commit to vipuldelwadia/calloutview that referenced this issue Jan 31, 2017
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

3 participants