<!--
{
  "availability" : [
    "iOS: 12.1.0 - 17.5.0",
    "iPadOS: 12.1.0 - 17.5.0",
    "macCatalyst: 13.1.0 - 17.5.0",
    "visionOS: 1.0.0 - 1.2.0"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPencilInteractionDelegate/pencilInteractionDidTap(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UIPencilInteractionDelegate(im)pencilInteractionDidTap:"
  },
  "title" : "pencilInteractionDidTap(_:)"
}
-->

# pencilInteractionDidTap(_:)

Tells the delegate that the user double-tapped Apple Pencil.

```
optional func pencilInteractionDidTap(_ interaction: UIPencilInteraction)
```

## Discussion

When handling the double tap, perform either:

- The action selected by the user in the Settings app, as specified by the [`preferredTapAction`](/documentation/UIKit/UIPencilInteraction/preferredTapAction) class property.
- An alternative behavior that gives the user the best experience for your app. Should you decide to support an alternative, provide an intuitive way for the user to learn about and enable that behavior.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)