---
title: UIToolTipInteraction
framework: uikit
role: symbol
role_heading: Class
path: uikit/uitooltipinteraction
---

# UIToolTipInteraction

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

## Declaration

```swift
@MainActor class UIToolTipInteraction
```

## Overview

Overview To show a tooltip when the pointer hovers over a view, add a UIToolTipInteraction object to the view. For example, the following code listings shows how to add a tooltip to a label: 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 property to an object that conforms to the UIToolTipInteractionDelegate protocol. To add a tooltip to a control derived from UIControl, use the convenience property toolTip; for example, to add a tooltip to the button: 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 property creates a tooltip interaction for the control, which you can retrieve from the 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()](uikit/uitooltipinteraction/init().md)
- [init(defaultToolTip:)](uikit/uitooltipinteraction/init(defaulttooltip:).md)

### Managing the interaction

- [isEnabled](uikit/uitooltipinteraction/isenabled.md)
- [defaultToolTip](uikit/uitooltipinteraction/defaulttooltip.md)

### Providing tooltip configurations

- [delegate](uikit/uitooltipinteraction/delegate.md)
- [UIToolTipInteractionDelegate](uikit/uitooltipinteractiondelegate.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [UIInteraction](uikit/uiinteraction.md)

## See Also

### Tooltips

- [Showing help tags for views and controls using tooltip interactions](uikit/showing-help-tags-for-views-and-controls-using-tooltip-interactions.md)
- [UIToolTipInteractionDelegate](uikit/uitooltipinteractiondelegate.md)
