Skip to content

Lakr233/NotchNotification

Repository files navigation

NotchNotification

Display notifications through your device's notch area.

The code has been refactored from NotchDrop and modified to better suit the current use case.

Preview

Preview GIF

Platforms

NotchNotification supports all AppKit platforms and works even on devices without a notch.

platforms: [.macOS(.v12)],

Usage

To add this package to your project:

dependencies: [
    .package(url: "https://github.com/Lakr233/NotchNotification.git", from: "1.1.0"),
]

To display a notification, use the following code:

NotchNotification.present(message: message)

For presenting an error notification with a custom interval:

NotchNotification.present(error: error, interval: 3)

To fully customize the notification view:

NotchNotification.present(
    bodyView: HStack {
        Image(systemName: "hand.point.right")
        Text(message).underline()
        Image(systemName: "hand.point.left")
    },
    interval: interval
)

License

This project is licensed under the MIT License. See the LICENSE file for more details.


© 2024 Lakr Aream. All Rights Reserved.