Gestures

From moasq/nanowave · View interactive version

Gestures is an AI agent skill from the GitHub repository moasq/nanowave. watchOS gesture patterns: Digital Crown, long press, swipe-to-dismiss, tap, watch-appropriate interactions. Use when implementing watchOS-specific patterns related to gestures.

How to use this skill

Skill file

Gestures (watchOS)

STANDARD GESTURE TABLE (watchOS):

| Gesture | SwiftUI API | Use Case |

|---------|-------------|----------|

| Tap | Button() | Primary actions |

| Long press | .onLongPressGesture | Secondary actions |

| Digital Crown | .digitalCrownRotation() | Value adjustment, scrolling |

| Swipe left/right | System back gesture | Navigation back |

| Scroll | ScrollView / List | Vertical content scrolling |

BUTTON VS ONTAPGESTURE:

DIGITAL CROWN:

@State private var crownValue: Double = 0

ScrollView {
    content
}
.digitalCrownRotation(
    $crownValue,
    from: 0,
    through: 100,
    by: 1,
    sensitivity: .medium,
    isContinuous: false,
    isHapticFeedbackEnabled: true
)

DIGITAL CROWN FOR VALUE SELECTION:

@State private var selectedIndex: Double = 0

VStack {
    Text("Temperature")
    Text("\(Int(selectedIndex + 60))\u{00B0}F")
        .font(AppTheme.Fonts.title2)
}
.digitalCrownRotation(
    $selectedIndex,
    from: 0,
    through: 40,
    by: 1,
    sensitivity: .low,
    isHapticFeedbackEnabled: true
)

LONG PRESS:

Button("Action") { primaryAction() }
    .onLongPressGesture {
        secondaryAction()
    }

NOT AVAILABLE ON watchOS:

LIST DELETE:

List {
    ForEach(items) { item in
        ItemRow(item: item)
    }
    .onDelete { indexSet in
        items.remove(atOffsets: indexSet)
    }
}

CONFIRMATION FOR DESTRUCTIVE ACTIONS:

.confirmationDialog("Delete?", isPresented: $showConfirm) {
    Button("Delete", role: .destructive) { delete() }
    Button("Cancel", role: .cancel) { }
}

RULES:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.