Quantcast
Channel: Active questions tagged haptic-feedback+iphone+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 9

No haptic feedback when testing on a actual iPhone

$
0
0

I followed Apple's guide regarding implementing haptic features to my app. I tested on my iPhone but when I trigger the haptic action (tap a button on a tableView controller), nothing happens.Thie is my implementation:

if supportHaptics {//line 95            do {                let player = try hapticsEngine.makePlayer(with: hapticPattern)                hapticsEngine.start(completionHandler:nil)                try player.start(atTime: 0)//line 99                hapticsEngine.stop(completionHandler: nil)            } catch {                print(error)            }}

I am pretty sure my hapticsEngine and hapticPattern are valid and there is no error, because if I set a break at line 95 and walk through the do block line by line, my phone DOES vibrate after line 99. It's just that after I removed the breakpoint and run the app, my iPhone doesn't send any haptic feedback.

What did I miss? Anything would help.


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>