---
title: pointerStyleProvider
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uibutton/pointerstyleprovider-y4eb
---

# pointerStyleProvider

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

## Declaration

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

## Discussion

Discussion To change the appearance of the pointer when it hovers over the button, create a UIButton.PointerStyleProvider closure that returns a UIPointerStyle describing the pointer shape and content effect. Then assign the closure to pointerStyleProvider. For example, the following code listing creates a pointer style that applies a lift effect to the button when the pointer hovers over it. 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.

## See Also

### Supporting pointer interactions

- [isPointerInteractionEnabled](uikit/uibutton/ispointerinteractionenabled.md)
- [isHovered](uikit/uibutton/ishovered.md)
- [UIButton.PointerStyleProvider](uikit/uibutton/pointerstyleprovider-swift.typealias.md)
- [UIButtonPointerStyleProvider](uikit/uibuttonpointerstyleprovider.md)
