DynamicNotchKit

0.1.0

Seamlessly adapt your macOS app to the notch era.
MrKai77/DynamicNotchKit

What's New

0.1.0

2025-04-20T20:22:31Z

Just a little release :)

DynamicNotchKit currently includes the DynamicNotch class, which lets you display SwiftUI content from the macOS notch. For devices without a notch, you can use a floating window style instead. This package also introduces two additional classes: DynamicNotchInfo and DynamicNotchProgress. While the documentation is a bit sparse right now, I’m working on improving it for the next release!


Important Update for Users

If you're using DynamicNotchKit in your project, please update your dependency rule to the 0.1.0 tag. Breaking changes are coming soon that will provide greater flexibility and configurability. To ensure your project continues to function smoothly during this transition, setting this version is highly recommended.

Have ideas or features you'd love to see in this package? Open an issue and let me know!

DynamicNotchKit

Examples:

Installation

Compatibility: macOS 12+

Add https://github.com/MrKai77/DynamicNotchKit in the “Swift Package Manager” tab in Xcode.

Usage

It's really easy! All the UI is handled by SwiftUI. That means, that you can use your existing views directly in DynamicNotchKit!

Here's an example:

let dynamicNotch = DynamicNotch {
    ContentView()
}
dynamicNotch.show(for: 2)

Where ContentView is a View.

Notice the show(for: 2). This will cause the popover to be displayed on the primary screen for two seconds before hiding itself automatically. The available methods to set the DynamicNotch's visibility are:

  • show(on screen: NSScreen = NSScreen.screens[0], for time: Double = 0)
  • hide()
  • toggle()

DynamicNotchKit also supports Macs without a notch, meaning that this package supports all Mac styles! You will see an example of that below.

DynamicNotchInfo

In addition, there is also a DynamicNotchInfo, which is a fine-tuned version of the DynamicNotch specifically tailored to show general information:

let notch = DynamicNotchInfo(
    icon: Image(systemName: "figure"),
    title: "Figure",
    description: "Looks like a person"
)
notch.show(for: 2)

This will result in a popover as so:

Furthermore, there is a .floating style, which will automatically be used on Macs without a notch:

In fact, DynamicNotchInfo was used 3/4 of the examples above :D

Anyways, there are more methods available, which I haven't listed here, as this package is still in development. I have also added much more detailed documentation to each available public method in the code, so if you are curious, please check there for more usage information!

...I'm probably going to improve these docs later :)

Feel free to ask questions/report issues in the Issues tab!

License

This project is licensed under the MIT license.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri May 16 2025 23:12:33 GMT-0900 (Hawaii-Aleutian Daylight Time)