AppleWatch: Digital Crown haptic feedback

461 Views Asked by At

I'm building WathcOS app. There is a simple view with just a label. And when user scroll Digital Crown, I would like to change label text.

In My WKInterfaceController I did

crownSequencer.delegate = self
crownSequencer.focus()

func crownDidRotate(_ crownSequencer: WKCrownSequencer?, rotationalDelta: Double) {
    crownAccumulator += rotationalDelta
    var crowAccumulatorDelta = 0.05
    if let speed = crownSequencer?.rotationsPerSecond {
        crowAccumulatorDelta = speed < 0.5 ? 0.05 : 0.01
    }

    if crownAccumulator > crowAccumulatorDelta {
        crownAccumulator = 0.0
        updateDistanceValue(distance + 0.1)
    } else if crownAccumulator < -crowAccumulatorDelta {
        crownAccumulator = 0.0
        updateDistanceValue(distance - 0.1)
    }
}

The problem is that I don't hear Native Digital Crown Haptic feedback, like when you scroll it on Watch Home screen or any other apps. I can add haptic feedback manually like: WKInterfaceDevice.current().play(.click) But this is not the same as Scroll haptic. How To turn on scroll haptic ? Why it doesn't work ?

P.S. Haptic is ON in Watch Settings.

1

There are 1 best solutions below

0
Jim On

In case someone faced same issue: No need to do something in code. It works by default. To make it works, volume on Watch settings shouldn't be minimum.