---
title: TipNSPopover
framework: tipkit
role: symbol
role_heading: Class
path: tipkit/tipnspopover
---

# TipNSPopover

A subclass of NSPopover that displays a popover tip in AppKit applications.

## Declaration

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

## Overview

Overview Use this to create a tip you want to display and lay out as a NSPopover. Adding and removing TipNSView from your app is done by listening to a tip’s shouldDisplayUpdates or statusUpdates. import Cocoa import TipKit

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: NSViewController {     @IBOutlet weak var catTracksFeatureButton: NSButton!

private var catTracksFeatureTip = CatTracksFeatureTip()     private var tipObservationTask: Task<Void, Never>?     private var tipPopover: TipNSPopover?

override func viewDidAppear() {         super.viewDidAppear()

tipObservationTask = tipObservationTask ?? Task { @MainActor in             for await shouldDisplay in catTracksFeatureTip.shouldDisplayUpdates {                 if shouldDisplay {                     tipPopover = TipNSPopover(catTracksFeatureTip)                     tipPopover?.show(relativeTo: catTracksFeatureButton.bounds, of: catTracksFeatureButton, preferredEdge: .minY)                 }                 else {                     tipPopover?.close()                     tipPopover = nil                 }             }         }     }

override func viewDidDisappear() {         super.viewDidDisappear()

tipObservationTask?.cancel()         tipObservationTask = nil     } }

## Topics

### Initializers

- [init(_:delegate:actionHandler:)](tipkit/tipnspopover/init(_:delegate:actionhandler:).md)

### Instance Properties

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

## Relationships

### Inherits From

- [NSPopover](appkit/nspopover.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSAccessibilityElementProtocol](appkit/nsaccessibilityelementprotocol.md)
- [NSAccessibilityProtocol](appkit/nsaccessibilityprotocol.md)
- [NSAppearanceCustomization](appkit/nsappearancecustomization.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSStandardKeyBindingResponding](appkit/nsstandardkeybindingresponding.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [NSUserActivityRestoring](appkit/nsuseractivityrestoring.md)

## See Also

### AppKit Views

- [TipNSView](tipkit/tipnsview.md)
