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

Setting SDLTouchManager.tapTimeThreshold to 0.0 causes a debug crash #1798

Closed
joeljfischer opened this issue Sep 29, 2020 · 0 comments
Closed
Labels
bug A defect in the library manager-streaming-video Relating to the manager layer - video streaming
Projects

Comments

@joeljfischer
Copy link
Contributor

Bug Report

Setting tapTimeThreshold to 0.0 is necessary to disable double taps, however, we have an assertion that doesn't allow a 0.0 tap time threshold.

Reproduction Steps
  1. Set tapTimeThreshold to 0.0 in a video streaming app
  2. Tap the screen a few times
Expected Behavior

The taps work properly as single taps

Observed Behavior

The taps cause a crash

OS & Version Information
  • iOS Version: n/a
  • SDL iOS Version: 7.0.0-develop
  • Testing Against: Sync Gen 3.4-dev
Test Case, Sample Code, and / or Example App

The fix is:

- (void)sdl_initializeSingleTapTimerAtPoint:(CGPoint)point {
    if (self.singleTapTimer != nil) {
        [self sdl_cancelSingleTapTimer];
    }

    if (self.tapTimeThreshold == 0.0) {
        [self sdl_singleTapTimerCallbackWithPoint:point];
    } else {
        __weak typeof(self) weakSelf = self;
        self.singleTapTimer = [[SDLTimer alloc] initWithDuration:self.tapTimeThreshold];
        self.singleTapTimer.elapsedBlock = ^{
            [weakSelf sdl_singleTapTimerCallbackWithPoint:point];
        };
        [self.singleTapTimer start];
    }
}
@joeljfischer joeljfischer added bug A defect in the library manager-streaming-video Relating to the manager layer - video streaming labels Sep 29, 2020
@joeljfischer joeljfischer added this to To do in v7.0.0 via automation Sep 29, 2020
@joeljfischer joeljfischer removed this from To do in v7.0.0 Oct 8, 2020
@joeljfischer joeljfischer added this to To do in v7.1.0 via automation Nov 6, 2020
@joeljfischer joeljfischer moved this from To do to Done in v7.1.0 Nov 6, 2020
@joeljfischer joeljfischer mentioned this issue Mar 15, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library manager-streaming-video Relating to the manager layer - video streaming
Projects
No open projects
Development

No branches or pull requests

1 participant