smartdevicelink / sdl_ios

Get your app connected to the 🚙, make your users feel like a 🌟
www.smartdevicelink.com
BSD 3-Clause "New" or "Revised" License
169 stars 105 forks source link

SDLTouchManager design question (for finer granularity touch events) #2078

Closed shiniwat closed 2 years ago

shiniwat commented 2 years ago

Description

This is not a bug; instead, it is rather a design question of SDLTouchManager. So I choose the "Best Practice" template.

sdl_ios library currently has the following SDLTouchManagerDelegate methods:

func touchManager(_ manager: SDLTouchManager, didReceiveSingleTapFor view: UIView?, at point: CGPoint)
func touchManager(_ manager: SDLTouchManager, didReceiveDoubleTapFor view: UIView?, at point: CGPoint)
func touchManager(_ manager: SDLTouchManager, panningDidStartIn view: UIView?, at point: CGPoint)
func touchManager(_ manager: SDLTouchManager, didReceivePanningFrom fromPoint: CGPoint, to toPoint: CGPoint)
func touchManager(_ manager: SDLTouchManager, panningDidEndIn view: UIView?, at point: CGPoint)
func touchManager(_ manager: SDLTouchManager, panningCanceledAt point: CGPoint)
func touchManager(_ manager: SDLTouchManager, pinchDidStartIn view: UIView?, atCenter point: CGPoint)
func touchManager(_ manager: SDLTouchManager, didReceivePinchAtCenter point: CGPoint, withScale scale: CGFloat)
func touchManager(_ manager: SDLTouchManager, didReceivePinchIn view: UIView?, atCenter point: CGPoint, withScale scale: CGFloat)
func touchManager(_ manager: SDLTouchManager, pinchDidEndIn view: UIView?, atCenter point: CGPoint)
func touchManager(_ manager: SDLTouchManager, pinchCanceledAtCenter point: CGPoint)

The question is that is it possible to handle finer granularity touch event, such as touch-down and touch-up, on SDL user app rather than "SingleTapFor"?

The reason of the question is that it's obviously poor that SDL VPM app cannot provide touch down feedback (e.g. button down feedback). Is there any design reason why sdl_ios library does not provide down/up event rather than "tap"?

The documentation at https://smartdevicelink.com/en/guides/iOS/video-streaming-for-navigation-apps/touch-input/ says, it is possible to implement onTouchEvent myself, but it's still not clear if user app can handle touch down/up event separately.

joeljfischer commented 2 years ago

Hi @shiniwat, this question would be best placed in our discussions area, or on Slack. For that reason, I will be closing this issue. The reason that we don't have a "touch down" event is that it's not a common use case. Usually you want to to know a touch down event in order to pan, pinch, etc. You can, however, get touch down information by subscribing to the raw touch event RPC. Hope that helps!