Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
Documentation
SDLTouchManager

SDLTouchManager Class Reference

Section Contents

Overview

Touch Manager responsible for processing touch event notifications.

touchEventDelegate

Notified of processed touches such as pinches, pans, and taps

Objective-C

@property (nonatomic, weak, nullable) id<SDLTouchManagerDelegate> touchEventDelegate;

touchEventHandler

Returns all OnTouchEvent notifications as SDLTouch and SDLTouchType objects.

Objective-C

@property (nonatomic, copy, nullable) SDLTouchEventHandler touchEventHandler;

Swift

var touchEventHandler: SDLTouchEventHandler? { get set }

tapDistanceThreshold

Distance between two taps on the screen, in the head unit’s coordinate system, used for registering double-tap callbacks.

Defaults to 50 px.

Objective-C

@property (nonatomic) CGFloat tapDistanceThreshold;

Swift

var tapDistanceThreshold: CGFloat { get set }

panDistanceThreshold

Minimum distance for a pan gesture in the head unit’s coordinate system, used for registering pan callbacks.

Defaults to 8 px.

Objective-C

@property (nonatomic) CGFloat panDistanceThreshold;

Swift

var panDistanceThreshold: CGFloat { get set }

tapTimeThreshold

Time (in seconds) between tap events to register a double-tap callback. This must be greater than 0.0.

Default is 0.4 seconds.

Objective-C

@property (nonatomic) CGFloat tapTimeThreshold;

Swift

var tapTimeThreshold: CGFloat { get set }

enableSyncedPanning

If set to NO, the display link syncing will be ignored. Defaults to YES.

Objective-C

@property (nonatomic) BOOL enableSyncedPanning;

Swift

var enableSyncedPanning: Bool { get set }

touchEnabled

Boolean denoting whether or not the touch manager should deliver touch event callbacks.

Default is true.

Objective-C

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isTouchEnabled) BOOL touchEnabled;

Swift

var isTouchEnabled: Bool { get set }

-cancelPendingTouches

Cancels pending touch event timers that may be in progress.

Currently only impacts the timer used to register single taps.

Objective-C

- (void)cancelPendingTouches;

Swift

func cancelPendingTouches()

-init

Initializer unavailable

Objective-C

- (nonnull instancetype)init;

-initWithHitTester:videoScaleManager:

Initialize a touch manager with a hit tester and a video scale manager.

Objective-C

- (nonnull instancetype)
    initWithHitTester:(nullable id<SDLFocusableItemHitTester>)hitTester
    videoScaleManager:
        (nonnull SDLStreamingVideoScaleManager *)videoScaleManager;

Parameters

hitTester

The hit tester to be used to correlate a point with a view

videoScaleManager

The scale manager that scales from the display screen coordinate system to the app’s viewport coordinate system

Return Value

The initialized touch manager

-syncFrame

Called by SDLStreamingMediaManager in sync with the streaming framerate. This helps to moderate panning gestures by allowing the UI to be modified in time with the framerate.

Objective-C

- (void)syncFrame;

Swift

func syncFrame()
View on GitHub.com
Previous Section Next Section