# Haptic Feedback

* [**iOS Haptic Feedback for iPhone 6s, 7 (or newer)**](https://medium.com/nerdmade/ios-haptic-feedback-for-iphone-7-and-6s-1bc6e7f1c285)
  * On iPhone 7 (or newer).

    ```swift
    let selectionFeedbackGenerator = UISelectionFeedbackGenerator()
    selectionFeedbackGenerator.prepare()
    selectionFeedbackGenerator.selectionChanged()
    ```
  * On iPhone 6s (via work-around)

    ```swift
    import AudioToolbox
    AudioServicesPlaySystemSound(1519)
    AudioServicesPlaySystemSound(1520)
    AudioServicesPlaySystemSound(1521)
    AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
    ```
* [**Taptic-Engine 微震動**](https://www.jianshu.com/p/5c990900d056)

```swift
if (@available(iOS 10.0, *)) 
{
    UIImpactFeedbackGenerator *generator = [[UIImpactFeedbackGenerator alloc] initWithStyle: UIImpactFeedbackStyleHeavy];
    [generator prepare];
    [generator impactOccurred];
}
```

* [**如何使用UIFeedbackGenerator 讓應用支持iOS 10 的觸覺反饋**](https://juejin.im/entry/5810433ac4c9710058a74100)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jacky-chen.gitbook.io/jackychen/user-interface/haptic-feedback.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
