I’ve been making an attempt to create customized vibrations for my app utilizing CoreHaptics on a brand new SwiftUI app. To make my code neat, I separated the perform that creates and begins the CHHapticEngine from the perform that runs the haptic sample like so:
static func StartEngine() throws {
//...
do
{
var engine = strive? CHHapticEngine()
strive engine?.begin()
}
//...
}
static func RunWithPattern(sample: CHHapticPattern) throws {
//...
do
{
var engine = strive CHHapticEngine()
let participant = strive engine.makePlayer(with: sample)
strive participant.begin(atTime: 0)
}
//...
}
Operating this offers me this error within the console, and no haptics felt on the machine: HapticUtils.h:59 _Haptic_Check: -[CHHapticEngine(CHHapticEngineInternal) checkEngineStateOnStart:]: self.working error -4805
.
I received 0 hits on google, even when utilizing generic components of that error message, therefore asking the query right here.