Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
rápido obtiene la posición del dedo cuando se presiona más tiempo

Tengo una vista de desplazamiento y me gustaría obtener la posición exacta del dedo cuando el usuario presiona la pantalla por más tiempo. O, si eso es posible, solo obtenga la posición del dedo en una vista de desplazamiento cuando el dedo se está moviendo.

Hasta ahora he intentado usar un LongGestureRecognizer. Aquí está mi código, todo funciona, pero todavía necesito la posición exacta del dedo. Aquí cómo creé Scrollview y GestureRecognizer.

 testScroll = UIScrollView(frame: CGRect(x: 0, y: 0, width: width, height: height)) self.view.addSubview(testScroll) testScroll.contentSize = CGSize(width: width, height: height*1.25) testScroll.delegate = self testREc = UILongPressGestureRecognizer(target: self, action: #selector(testprint(sender:))) testScroll.addGestureRecognizer(testREc)

si existe la posibilidad de obtener la posición de esta manera, o exactamente a través de (función de impresión de prueba), sería útil para mí

Si tienes algún consejo, agradecería tu ayuda.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Establece el delegate de tu UILongPressGestureRecognizer e implementa gestureRecognizerShouldBegin() .

Allí puede obtener la ubicación táctil que activó la pulsación larga.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!