Documentation

PolytopicNotch

A pill that hangs from the MacBook notch, for your Mac app.

Overview

extension MyNotch {
    func post(_ headline: String) {
        content.showing = NotchBody(height: 34) { Headline(text: headline) }
        content.status = .showing
        content.want = .notice
        Task { [weak self] in
            try? await Task.sleep(for: .seconds(3))
            self?.content.status = .quiet
            self?.content.want = .quiet
        }
    }
}

You set what to show on NotchContent; NotchPanelController places the pill, sizes and animates it, opens it on hover, and keeps it clear of other notch apps and menu bar managers. Questions the pill can't show float in a window (NotchPromptWindowController). Without a notch, the pill hangs below the menu bar. Apps that opt in share the notch through NotchDock.

Start with Getting started, then Recipes.

Articles

  • Getting started

    Add the package and show a first pill at the notch.

  • Recipes

    Copy-paste code for the common tasks.

  • Your own panel

    Put any SwiftUI view in the pill.

  • Live lists

    A list in the pill that follows its newest item and holds still while the user works with it.

  • The dock

    Several notch apps share the notch instead of making room for each other as strangers.

  • How the pill behaves, and why

    Levels, clicks, hover timing, other notch apps and menu bar managers.

  • Testing

    Test your notch without touching the real dock or the user's settings, and run the package's own tests.

  • Vendoring a release

    Keep a copy of a tagged release in your repository instead of a package dependency.

  • API reference

    Every public type, with its documentation comments, generated by DocC from the 1.1.0 release.