---
title: TipUIView
framework: tipkit
role: symbol
role_heading: Class
path: tipkit/tipuiview
---

# TipUIView

A user interface element that represents a tip in UIKit applications.

## Declaration

```swift
@MainActor @objc @preconcurrency final class TipUIView
```

## Overview

Overview Use this view to create a tip you want to display and lay out as a UIView. To configure the content and appearance of your view, use the init(_:arrowEdge:actionHandler:) function and provide a tip along with an optional arrow edge and optional action. Set the background color of your tip view using backgroundColor. Adding and removing TipUIView from your app is done by listening to a tip’s shouldDisplayUpdates or statusUpdates. import TipKit import UIKit

struct CatTracksFeatureTip: Tip {     var title: Text {         Text("Sample tip title")     }

var message: Text? {         Text("Sample tip message")     }

var image: Image? {         Image(systemName: "globe")     } }

class CatTracksViewController: UIViewController {     private var catTracksFeatureTip = CatTracksFeatureTip()     private var tipObservationTask: Task<Void, Never>?     private weak var tipView: TipUIView?

override func viewDidAppear(_ animated: Bool) {         super.viewDidAppear(animated)

tipObservationTask = tipObservationTask ?? Task { @MainActor in             for await shouldDisplay in catTracksFeatureTip.shouldDisplayUpdates {                 if shouldDisplay {                     let tipHostingView = TipUIView(catTracksFeatureTip)                     tipHostingView.translatesAutoresizingMaskIntoConstraints = false                                                              view.addSubview(tipHostingView)

view.addConstraints([                         tipHostingView.centerYAnchor.constraint(equalTo: view.centerYAnchor),                         tipHostingView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 20.0),                         tipHostingView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -20.0)                     ])

tipView = tipHostingView                 }                 else {                     tipView?.removeFromSuperview()                     tipView = nil                 }             }         }     }

override func viewWillDisappear(_ animated: Bool) {         super.viewWillDisappear(animated)

tipObservationTask?.cancel()         tipObservationTask = nil     } }

## Topics

### Initializers

- [init(_:arrowEdge:actionHandler:)](tipkit/tipuiview/init(_:arrowedge:actionhandler:).md)

### Instance Properties

- [backgroundColor](tipkit/tipuiview/backgroundcolor.md)
- [backgroundStyle](tipkit/tipuiview/backgroundstyle.md)
- [cornerRadius](tipkit/tipuiview/cornerradius.md)
- [imageSize](tipkit/tipuiview/imagesize.md)
- [imageStyle](tipkit/tipuiview/imagestyle.md)
- [viewStyle](tipkit/tipuiview/viewstyle.md)

## Relationships

### Inherits From

- [UIView](uikit/uiview.md)

### Conforms To

- [CALayerDelegate](quartzcore/calayerdelegate.md)
- [CLBodyIdentifiable](corelocation/clbodyidentifiable.md)
- [CMBodyIdentifiable](coremotion/cmbodyidentifiable.md)
- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [UIAccessibilityIdentification](uikit/uiaccessibilityidentification.md)
- [UIActivityItemsConfigurationProviding](uikit/uiactivityitemsconfigurationproviding.md)
- [UIAppearance](uikit/uiappearance.md)
- [UIAppearanceContainer](uikit/uiappearancecontainer.md)
- [UICoordinateSpace](uikit/uicoordinatespace.md)
- [UIDynamicItem](uikit/uidynamicitem.md)
- [UIFocusEnvironment](uikit/uifocusenvironment.md)
- [UIFocusItem](uikit/uifocusitem.md)
- [UIFocusItemContainer](uikit/uifocusitemcontainer.md)
- [UILargeContentViewerItem](uikit/uilargecontentvieweritem.md)
- [UIPasteConfigurationSupporting](uikit/uipasteconfigurationsupporting.md)
- [UIPopoverPresentationControllerSourceItem](uikit/uipopoverpresentationcontrollersourceitem.md)
- [UIResponderStandardEditActions](uikit/uiresponderstandardeditactions.md)
- [UITraitChangeObservable](uikit/uitraitchangeobservable-67e94.md)
- [UITraitEnvironment](uikit/uitraitenvironment.md)
- [UIUserActivityRestoring](uikit/uiuseractivityrestoring.md)

## See Also

### UIKit Views

- [TipUIPopoverViewController](tipkit/tipuipopoverviewcontroller.md)
- [TipUICollectionViewCell](tipkit/tipuicollectionviewcell.md)
- [TipUICollectionReusableView](tipkit/tipuicollectionreusableview.md)
