<!--
{
  "availability" : [
    "macOS: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TipKit",
  "identifier" : "/documentation/TipKit/TipNSPopover",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "TipKit"
    ],
    "preciseIdentifier" : "c:@M@TipKit@objc(cs)TipNSPopover"
  },
  "title" : "TipNSPopover"
}
-->

# TipNSPopover

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

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

## Overview

Use this to create a tip you want to display and lay out as a <doc://com.apple.documentation/documentation/AppKit/NSPopover>.

Adding and removing TipNSView from your app is done by listening to a tip’s [`shouldDisplayUpdates`](/documentation/TipKit/Tip/shouldDisplayUpdates) or [`statusUpdates`](/documentation/TipKit/Tip/statusUpdates).

```swift
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
    }
}
```

---

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)