Skip to content

Alert on top of scroll view doesn't hide until tracking actions complete #7

tposch opened this Issue Feb 4, 2013 · 3 comments

3 participants

tposch commented Feb 4, 2013

I have a UIWebView in my application and I am subscribing to the UIScrollView events being generated by the webView.scrollView property. I am using the OLGhostAlertView to display notifications to the user while they are scrolling through the page. I noticed that if I display a notification while I am dragging my finger and I continue to drag my finger, then the hide() method wasn't being called until after I released my finger (long after the timeout had expired).

I resolved the issue by changing this line of code:

    [self performSelector:@selector(hide) withObject:nil afterDelay:self.timeout];

to this:

    [self performSelector:@selector(hide) withObject:nil afterDelay:self.timeout inModes:[NSArray arrayWithObject:NSRunLoopCommonModes]];

I do not know all the side effects of that change but it might be worth introducing to your control. I appreciate you posting this control for all to use!

Onda member
radutzan commented Feb 6, 2013

Thanks a lot for sharing this. Sadly, I don't know the potential consequences of that change either, so I'd rather refrain from adding this to the code. I will make a reference to this issue on a future revision of the README for people who might encounter the same problem.

roostr commented Jun 5, 2013

Hi, I came here to submit this pull request, but I see it's already solved.

This technique seems to be the Apple-endorsed fix. See WWDC 2012 video "Enhancing User Experience with Scroll Views" starting at minute 35.

@radutzan radutzan added a commit that closed this issue Jun 18, 2013
@radutzan radutzan Fix #7. 0229bce
@radutzan radutzan closed this in 0229bce Jun 18, 2013
Onda member

Thanks a lot for your input, people. Sorry this took so long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.