performFeedback(_:performanceTime:)
Performs the haptic feedback described by one or more alignment feedback tokens.
Declaration
func performFeedback(_ alignmentFeedbackTokens: [any NSAlignmentFeedbackToken], performanceTime: NSHapticFeedbackManager.PerformanceTime)Parameters
- alignmentFeedbackTokens:
One or more feedback tokens prepared for specific alignment locations by calling Alignmentfeedbacktokenformovement(in:previouspoint:alignedpoint:defaultpoint:), Alignmentfeedbacktokenforhorizontalmovement(in:previousx:alignedx:defaultx:), or Alignmentfeedbacktokenforverticalmovement(in:previousy:alignedy:defaulty:). Typically, no more than one feedback token per dimension (horizontal/vertical) should be provided.
- performanceTime:
The time, of type
NSHapticFeedbackPerformanceTime, when the feedback should be provided to the user.
Discussion
Call this method to initiate haptic feedback to the user. Pass it one or more alignment feedback tokens of type NSAlignmentFeedbackToken and a time to execute of type NSHapticFeedbackPerformanceTime. Call this method immediately before moving the object to its new aligned position.