iOS: let keyboard gesture work better with other gestures

Let the keyboard gesture work better alongside other gestures
by reporting that it should:

1. not prevent other gestures from triggering. This means that
    even if our gesture triggers (we close the keyboard), gestures
    attached to sub-views will still continue tracking.
2. not be prevented by other gestures. This means that if
    a gesture in a sub-view triggeres before our gesture, our gesture
    will still continue to track.

In short it means that regardless of other gestures, we always
close the keyboard if our text responder is first responder and
the user flicks down. And we do so as "silently" as possible.

Change-Id: I22386b5ef5dedbc498a2899929ddd07424e514d8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
bb10
Richard Moe Gustavsen 2014-12-02 15:33:55 +01:00
parent de04841e19
commit fb9eca8c9c
1 changed files with 12 additions and 0 deletions

View File

@ -162,6 +162,18 @@ static QUIView *focusView()
// -------------------------------------------------------------------------
- (BOOL)canPreventGestureRecognizer:(UIGestureRecognizer *)other
{
Q_UNUSED(other);
return NO;
}
- (BOOL)canBePreventedByGestureRecognizer:(UIGestureRecognizer *)other
{
Q_UNUSED(other);
return NO;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesBegan:touches withEvent:event];