Sample code for Touch events on iOS?

Seems like a Xojo control on iOS doesn’t get PointerDown/PointerUp events for the plugin controls automatically.
Is there sample code on how to do them?

Are you saying these events on the REALmobileControlBehaviour are not being invoked?

/// PointerDown(position As Xojo.Point, pointerInfoArray() As PointerEvent)
RBBoolean (*pointerDownFunction)(REALcontrolInstance, REALobject position, REALobject pointerInfoArray);
/// PointerUp(position As Xojo.Point, pointerInfoArray() As PointerEvent)
RBBoolean (*pointerUpFunction)(REALcontrolInstance, REALobject position, REALobject pointerInfoArray);

no. Since I didn’t implement them, I thought user would get those events by xojo. But looks like I need to forward them to new events.

Right, since mobile plugin controls inherit from MobileUIControl and those events do not exist there… file a feature request if you believe they should.

So I tried the callbacks, but looks like they may not fire.
Do we need some stub code to pass touch events to Xojo to feed those?

Nothing special, have you already looked at the EyeControlMobile example?

Maybe it’s only for controls in Xojo with paint event.
Because we have an UIView wrapper, so they don’t apply as the mouse click doesn’t come through to the Xojo framework, I assume?

If you’ve overridden the controlHandleGetter to switch out the default UIView that we provide then yes.

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.