Slide 20
Slide 20 text
© ZOZO, Inc.
20
Hapticίϯςϯπ࡞
// Transient Event
let transientEvent = CHHapticEvent(eventType: .hapticTransient,
parameters: [
CHHapticEventParameter(parameterID: .hapticIntensity, value: 0.3),
CHHapticEventParameter(parameterID: .hapticSharpness, value: 0.3)],
relativeTime: 0.2)
// Audio Event
let audioResourceID = try! engine.registerAudioResource(resourceURL)
let audioEvent = CHHapticEvent(audioResourceID: audioResourceID, parameters:
[CHHapticEventParameter(parameterID: .audioVolume, value: 0.3)], relativeTime: 0)
do {
// ΠϕϯτΛͱʹHapticύλʔϯΛ࡞
let pattern = try CHHapticPattern(events: [transientEvent, audioEvent], parameters: [])
} catch let error {ɾɾɾ}