> For the complete documentation index, see [llms.txt](https://eneskaraosman53.gitbook.io/swiftui/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eneskaraosman53.gitbook.io/swiftui/gestures/tapgesture.md).

# TapGesture

Tappable Views (Image, Text, Anything)

**Usage**

```swift
Rectangle()
    .foregroundColor(.orange)
    .frame(width: 100, height: 100)
    .gesture(
        TapGesture(count: 1).onEnded {
            // Action
        }
    )
    
// Much easier one,
// we can use .onTapGesture directly on a view
Rectangle()
    .foregroundColor(.orange)
    .frame(width: 100, height: 100)
    .onTapGesture {
        // Action    
    }
```

`TapGesture` is usable for every `View`
