PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, September 29, 2022

[FIXED] How to detect touches on UIViewController on tvOS

 September 29, 2022     apple-tv, swift, tvos, uigesturerecognizer     No comments   

Issue

I am making a jumping game for the Apple TV on tvOS. I'd like to know when the user touches the remote in a UIViewController. An action for when the touch begins (character jumps upwards) and when it ends (character falls downwards).

Almost all gesture examples on the Apple documentation site are for clicking, not simply touching without pressing. Does anyone know how to do this in Swift for tvOS?


Solution

You can use touchesBegan and touchesEnded just like on iOS.



Answered By - Justin Voss
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing