<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIToolTipInteraction",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIToolTipInteraction"
  },
  "title" : "UIToolTipInteraction"
}
-->

# UIToolTipInteraction

An interaction object that makes it possible to show a tooltip when hovering a pointer over a view or control.

```
@MainActor class UIToolTipInteraction
```

## Overview

To show a tooltip when the pointer hovers over a view, add a [`UIToolTipInteraction`](/documentation/UIKit/UIToolTipInteraction) object to the view. For example, the following code listings shows how to add a tooltip to a label:

```swift
let label = UILabel()
label.text = "Label with a tooltip"

let tooltipInteraction = UIToolTipInteraction(defaultToolTip: "The label's tooltip.")
label.addInteraction(tooltipInteraction)
```

If you want your app to determine the tooltip text at a later time — for instance, to reflect the current state of your app — set the interaction’s [`delegate`](/documentation/UIKit/UIToolTipInteraction/delegate) property to an object that conforms to the [`UIToolTipInteractionDelegate`](/documentation/UIKit/UIToolTipInteractionDelegate) protocol.

To add a tooltip to a control derived from [`UIControl`](/documentation/UIKit/UIControl), use the convenience property [`toolTip`](/documentation/UIKit/UIControl/toolTip); for example, to add a tooltip to the button:

```swift
let button = UIButton(configuration: configuration, primaryAction: action)
button.toolTip = "Click to buy this item. You'll have a chance to change your mind before confirming your purchase."
```

Setting the [`toolTip`](/documentation/UIKit/UIControl/toolTip) property creates a tooltip interaction for the control, which you can retrieve from the [`toolTipInteraction`](/documentation/UIKit/UIControl/toolTipInteraction) property.

> Note:
> Tooltips appear when your app runs in macOS or visionOS. To show a tooltip in macOS, your app must be an iPhone or iPad app running on a Mac with Apple silicon, or built with Mac Catalyst.

## Topics

### Creating a tooltip interaction

[`init()`](/documentation/UIKit/UIToolTipInteraction/init())

Creates a tooltip interaction object.

[`init(defaultToolTip:)`](/documentation/UIKit/UIToolTipInteraction/init(defaultToolTip:))

Creates a tooltip interaction object and sets the default tooltip text.

### Managing the interaction

[`isEnabled`](/documentation/UIKit/UIToolTipInteraction/isEnabled)

A Boolean value that indicates whether the tooltip interaction is in the enabled state.

[`defaultToolTip`](/documentation/UIKit/UIToolTipInteraction/defaultToolTip)

The text that appears in a tooltip by default.

### Providing tooltip configurations

[`delegate`](/documentation/UIKit/UIToolTipInteraction/delegate)

An object that provides text that a tooltip displays instead of the default text.

[`UIToolTipInteractionDelegate`](/documentation/UIKit/UIToolTipInteractionDelegate)

An interface that provides tooltip settings to an interaction.



---

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)