okooo5km / NotchNotification

Display Notification Inside Mac's Notch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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(.v13)],

Usage

To add this package to your project:

dependencies: [
    .package(url: "https://github.com/Lakr233/NotchNotification.git", from: "1.0.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.

About

Display Notification Inside Mac's Notch.

License:MIT License


Languages

Language:Swift 96.6%Language:Shell 3.4%