Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: On Tap Gesture #519

Open
Awesomeplayer165 opened this issue Sep 29, 2022 · 6 comments
Open

Feature Request: On Tap Gesture #519

Awesomeplayer165 opened this issue Sep 29, 2022 · 6 comments
Labels
SwiftUI compatibility Tokamak API differences with SwiftUI

Comments

@Awesomeplayer165
Copy link

Thank you so much for creating this amazing tool!
I was wondering if there was any way to check if a View has been touched/tapped by the user? In SwiftUI, I would accomplish this by using a .onTapGesture {} on the SwiftUI View. Maybe there already is something equivalent and I just haven't found it yet.

Thanks!

@libewa
Copy link

libewa commented Nov 22, 2022

this would be the equivalent of onclick="" in HTML

@carson-katri
Copy link
Member

Two current solutions are to wrap the View in a Button or a HTML view with a listener for click events.

All of SwiftUIs gesture APIs still need to be built out.

@carson-katri carson-katri added the SwiftUI compatibility Tokamak API differences with SwiftUI label Nov 22, 2022
@libewa
Copy link

libewa commented Nov 25, 2022

Yeah but Buttons are ugly.
And with HTML you then can't execute Swift code.

@carson-katri
Copy link
Member

@libewa Please see this second example in the README of a HTML view calling Swift code on the mouse move event. It could be adapted to onclick fairly easily: https://github.com/TokamakUI/Tokamak#arbitrary-html

@MrDevel0per
Copy link

I agree we need this feature implimented on its own, without a button.

@shial4
Copy link

shial4 commented Aug 8, 2023

work is being done here
#530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SwiftUI compatibility Tokamak API differences with SwiftUI
Development

No branches or pull requests

5 participants