TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

How to use a swipe gesture on Apple TV with a Siri remote? SwiftUI Xcode 13

Forums > tvOS

Hello I'm brand new here. (brand new to code as well for that matter) so I apologize in advance if I'm doing this incorectly or asking a dumb question.

I've created a custom view which I would like to modify based on a swipe gesture on the siri remote. I've searched for hours to find a solution and cant find anything.

It's incredible to me that there dosen't seem to be a simple default solution for this.

eg:

@State var text: String = "some text"

some view {

Text(text) .focusable .onSwipe(swipe: .left) { text = "new text" } }

// a swipe left on the siri remote results in the text changing from "some text" to "new text"

this is a simplified version of what I would like to accomplish and obviously it doesn’t work. i'ts ok if the answer is more complicated and less elegant. I just want some way to achieve the same result.

Many thanks in advance for any answers or pointers!

5      

Hacking with Swift is sponsored by String Catalog.

SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!

Localize My App

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.