0

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.

Jim
  • 8,874
  • 16
  • 68
  • 125
  • I am sitting in the exact same situation, and I have been in talk with Apple, on the forums and filled a radar. It seems like its not possible. Please see: - https://forums.developer.apple.com/thread/115562 - Radar id: 50009593 Im still trying to hack a way to have it, but have not found it yet. – magnuskahr Apr 22 '19 at 08:33
  • @magnuskahr Good to know. Thanks. I'm sure there should be solution. I already found couple applications with behavior we need. – Jim Apr 22 '19 at 10:59
  • if you find a way to control the feedback in the crown, please let me know - it will save my bachelor – magnuskahr Apr 22 '19 at 11:02
  • @magnuskahr I don't know what happen, but its seems to be working now. Not sure what happen and when. I think I turn volume on apple watch settings. – Jim May 09 '19 at 08:59
  • could I maybe have a look at your project? If so, please contact me on twitter or so. – magnuskahr May 09 '19 at 09:03
  • I just experienced this and I think it's a bug with the dev environment. I receive no haptic for the crown when I run a debug session on the physical device with xcode but I do if I minimize and reopen the app. Checkin in debug: it is on for the crown sequencer all the time. – Peter Porfy Apr 18 '20 at 16:22

1 Answers1

0

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.

Jim
  • 8,874
  • 16
  • 68
  • 125