<!--
{
  "availability" : [
    "iOS: 13.4.0 -",
    "iPadOS: 13.4.0 -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIButton/PointerStyleProvider-swift.typealias",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So8UIButtonC5UIKitE20PointerStyleProvidera"
  },
  "title" : "UIButton.PointerStyleProvider"
}
-->

# UIButton.PointerStyleProvider

A type alias defining a closure that returns a pointer style to apply to a button.

```
typealias PointerStyleProvider = (UIButton, UIPointerEffect, UIPointerShape) -> UIPointerStyle?
```

## Parameters

`button`

The button requesting the pointer style.

`proposedEffect`

The content effect that the system suggests.

`proposedShape`

The shape of the pointer that the system suggests.

## Return Value

The pointer style to apply to the button when the pointer hovers over it. Return `nil` when you don’t want to apply a pointer style to the button.

## Discussion

To change the appearance of the pointer when it hovers over the button, create a pointer style provider closure and assign it to the button’s [`pointerStyleProvider`](/documentation/UIKit/UIButton/pointerStyleProvider-y4eb) property. For instance, the following code listing increases the size of the pointer, while keeping the proposed content effect, to provide better highlighting of the button when the pointer hovers over it.

```swift
straightLineModeButton?.pointerStyleProvider = { button, proposedEffect, proposedShape -> UIPointerStyle? in
    var rect = button.bounds.insetBy(dx: -12.0, dy: -14.0)
    rect = button.convert(rect, to: proposedEffect.preview.target.container)
    return UIPointerStyle(effect: proposedEffect, shape: .roundedRect(rect))
}
```

---

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)