<!--
{
  "availability" : [
    "iOS: 13.4.0 -",
    "iPadOS: 13.4.0 -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIButton/pointerStyleProvider-y4eb",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So8UIButtonC5UIKitE20pointerStyleProviderSo09UIPointerD0CSgAB_AC0F6EffectOAC0F5ShapeOtcSgvp"
  },
  "title" : "pointerStyleProvider"
}
-->

# pointerStyleProvider

A closure that returns the pointer style to use when the pointer hovers over the button.

```
@MainActor @preconcurrency var pointerStyleProvider: UIButton.PointerStyleProvider? { get set }
```

## Discussion

To change the appearance of the pointer when it hovers over the button, create a [`UIButton.PointerStyleProvider`](/documentation/UIKit/UIButton/PointerStyleProvider-swift.typealias) closure that returns a [`UIPointerStyle`](/documentation/UIKit/UIPointerStyle) describing the pointer shape and content effect. Then assign the closure to [`pointerStyleProvider`](/documentation/UIKit/UIButton/pointerStyleProvider-y4eb). For example, the following code listing creates a pointer style that applies a lift effect to the button when the pointer hovers over it.

```swift
threadColorButton.pointerStyleProvider = { button, proposedEffect, proposedShape -> UIPointerStyle? in
    let cornerRadius: CGFloat = 4
    let parameters = UIPreviewParameters()
    let shapePath = UIBezierPath(roundedRect: button.bounds, cornerRadius: cornerRadius)
    parameters.shadowPath = shapePath
    let preview = UITargetedPreview(view: proposedEffect.preview.view, parameters: parameters, target: proposedEffect.preview.target)
    
    let rect = button.convert(button.bounds, to: preview.target.container)
    return UIPointerStyle(effect: .lift(preview), shape: .roundedRect(rect, radius: cornerRadius))
}
```

For more information, see [Enhancing your iPad app with pointer interactions](/documentation/UIKit/enhancing-your-ipad-app-with-pointer-interactions).

---

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)