Posts

Post not yet marked as solved
0 Replies
321 Views
Hi! I am trying to make and app that usses an accessory for controlling the user interaction. I am able to position the user position in the screen in X and Y coordinates, but now I need make a click in that point. The accessory can also be used as an AssistiveTouch device, but in this case I want to have the control of the actions in the app. Is this posible? I have been testing many things but none of them seems to work. Here some pieces of code I have used: private func performTouchInView(){ let point = CGPoint(x:pointer.center.x,y:pointer.center.y) // myView.touchesBegan(<#T##touches: Set<UITouch>##Set<UITouch>#>, with: <#T##UIEvent?#>) // myView.hitTest(point, with:UIEvent.EventType.presses) //myView, at: point let touch = UITouch() touch.view?.point(inside: point, with: nil) let event = UIEvent() // touch?.phase = phase UIApplication.shared.sendEvent(event) } Basically I am trying to use UITouch and UIEvent combination, based in a CGPoint. I have seen also, that in macOS there is a function called "performClick()", is there something similar in iOS? Sumarizing, is there any way in iOS to perform a click in the app view based in a X and Y position? Independently of what it is in that position. Am I missing someting in my approach? thanks in advance! Am I missing something?
Posted
by txaskel.
Last updated
.