Comprehensive guide to SwiftUI gesture recognition with composition patterns, state management, and accessibility integration.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionaxiom-swiftui-gesturesExecute the skills CLI command in your project's root directory to begin installation:
Fetches axiom-swiftui-gestures from charleswiltgen/axiom and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate axiom-swiftui-gestures. Access via /axiom-swiftui-gestures in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
767
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
767
stars
Comprehensive guide to SwiftUI gesture recognition with composition patterns, state management, and accessibility integration.
These are real questions developers ask that this skill is designed to answer:
→ The skill covers DragGesture state management patterns and shows how to properly update view offset with @GestureState
→ The skill demonstrates gesture composition with .simultaneously, .sequenced, and .exclusively to resolve gesture conflicts
→ The skill shows the .sequenced pattern for combining LongPressGesture with DragGesture in the correct order
→ The skill covers @GestureState automatic reset behavior and the updating parameter for proper state management
→ The skill demonstrates .accessibilityAction patterns and providing alternative interactions for VoiceOver users
What interaction do you need?
├─ Single tap/click?
│ └─ Use Button (preferred) or TapGesture
│
├─ Drag/pan movement?
│ └─ Use DragGesture
│
├─ Hold before action?
│ └─ Use LongPressGesture
│
├─ Pinch to zoom?
│ └─ Use MagnificationGesture
│
├─ Two-finger rotation?
│ └─ Use RotationGesture
│
├─ Multiple gestures together?
│ ├─ Both at same time? → .simultaneously
│ ├─ One after another? → .sequenced
│ └─ One OR the other? → .exclusively
│
└─ Complex custom behavior?
└─ Create custom Gesture conforming to Gesture protocol
Text("Submit")
.onTapGesture {
submitForm()
}
Problems:
Button("Submit") {
submitForm()
}
.buttonStyle(.bordered)
When to use TapGesture: Only when you need tap data (location, count) or non-standard tap behavior:
Image("map")
.onTapGesture(count: 2) { // Double-tap for details
showDetails()
}
.onTapGesture { location in // Single tap to pin
addPin(at: location)
}
@State private var offset = CGSize.zero
var body: some View {
Circle()
.offset(offset)
.gesture(
DragGesture()
.onChanged { value in
offset = value.translation // ❌ Updates every frame, causes jank
}
)
}
Problems:
@GestureState private var dragOffset = CGSize.zero
@State private var position = CGSize.zero
var body: some View {
Circle()
.offset(x: position.width + dragOffset.width,
y: position.height + dragOffset.height)
.gesture(
DragGesture()
.updating($dragOffset) { value, state, _ in
state = value.translation // Temporary during drag
}
.onEnded { value in
position.width += value.translation.width // Commit final
position.height += value.translation.height
}
)
}
Why: GestureState automatically resets to initial value when gesture ends, preventing state corruption.
@GestureState private var isDetectingLongPress = false
@State private var completedLongPress = false
var body: some View {
Text("Press and hold")
.foregroundStyle(isDetectingLongPress ? .red : .blue)
.gesture(
LongPressGesture(minimumDuration: 1.0)
.updating($isDetectingLongPress) { currentState, gestureState, _ in
gestureState = currentState // Visual feedback during press
}
.onEnded { _ in
completedLongPress = true // Action after hold
}
)
}
Key parameters:
minimumDuration: How long to hold (default 0.5 seconds)maximumDistance: How far finger can move before cancelling (default 10 points)@GestureState private var magnificationAmount = 1.0
@State private var currentZoom = 1.0
var body: some View {
Image("photo")
.scaleEffect(currentZoom * magnificationAmount)
.gesture(
MagnificationGesture()
.updating($magnificationAmount) { value, state, _ in
state = value.magnification
}
.onEnded { value in
currentZoom *= value.magnification
}
)
}
Platform notes:
@GestureState private var rotationAngle = Angle.zero
@State private var currentRotation = Angle.zero
var body: some View {
Rectangle()
.fill(.blue)
.frame(width: 200, height: 200)
.rotationEffect(currentRotation + rotationAngle)
.gesture(
RotationGesture()
.updating($rotationAngle) { value, state, _ in
state = value.rotation
}
.onEnded { value in
currentRotation += value.rotation
}
)
}
@GestureState private var dragOffset = CGSize.zero
@GestureState private var mPrerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
anthropics/claude-code
mblode/agent-skills
github/awesome-copilot
sickn33/antigravity-awesome-skills
leonxlnx/taste-skill
erichowens/some_claude_skills
axiom-swiftui-gestures fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Useful defaults in axiom-swiftui-gestures — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
I recommend axiom-swiftui-gestures for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
We added axiom-swiftui-gestures from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Registry listing for axiom-swiftui-gestures matched our evaluation — installs cleanly and behaves as described in the markdown.
axiom-swiftui-gestures fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Solid pick for teams standardizing on skills: axiom-swiftui-gestures is focused, and the summary matches what you get after install.
We added axiom-swiftui-gestures from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
I recommend axiom-swiftui-gestures for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
Useful defaults in axiom-swiftui-gestures — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
showing 1-10 of 61