Swiftpack.co - danielsaidi/SystemNotification as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by danielsaidi.
danielsaidi/SystemNotification 0.7.2
SystemNotification is a SwiftUI library that lets you mimic the native iOS system notification. It supports extensive styling, custom views and can be used on all major Apple platforms.
⭐️ 221
🕓 12 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/danielsaidi/SystemNotification.git", from: "0.7.2")

SystemNotification Logo

Version Swift 5.6 Swift UI MIT License Twitter: @danielsaidi Mastodon: @danielsaidi@mastodon.social

About SystemNotification

SystemNotification can be used to present notifications that mimic the native iOS system notification that for instance are shown when you toggle silent mode on and off, connect your AirPods etc.

The result can look like this, or completely different:

System notifications can be styled and customized to great extent. You can also use completely custom views.

SystemNotification supports iOS 14, macOS 11, tvOS 14 and watchOS 7.


SystemNotification can be installed with the Swift Package Manager:


If you prefer to not have external dependencies, you can also just copy the source code into your app.

Getting started

The online documentation has a getting started guide guide to help you get started with SystemNotification.

SystemNotification supports both state- and context-based notifications, where context-based ones give you the most flexibility:

struct ContentView: View {

    private var notificationContext = SystemNotificationContext()

    var body: some View {
        NavigationView {
            List {
                Button("Show notification", action: showNotification)
                Button("Show orange notification", action: showCustomNotification)
    func showNotification() {
        notificationContext.present {
                icon: Image(systemName: "􀋚"),
                title: "Silent mode",
                text: "Off",
                style: .init(iconColor: .red)
    func showCustomNotification() {
            style: SystemNotificationStyle(backgroundColor: .orange)
        ) {
            VStack {
                Text("Custom notification")
                Text("SystemNotification supports using any content views you like.")

In the code above, we both apply a system notification, but also passes in the context as an environment object. This lets other views in the view hierarchy use it to present a notifications from the same root view.

For more information, please see the online documentation and getting started guide.


The online documentation has articles, code examples etc. that let you overview the various parts of the library.

Demo Application

The demo app lets you explore the library on iOS and macOS. To try it out, just open and run the Demo project.

Support this library

I manage my various open-source projects in my free time and am really thankful for any help I can get from the community.

You can sponsor this project on GitHub Sponsors or get in touch for paid support.


Feel free to reach out if you have questions or if you want to contribute in any way:


SystemNotification is available under the MIT license. See the LICENSE file for more info.


Stars: 221
Last commit: 4 days ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

12 weeks ago

✨ New features

  • SystemNotificationPresenter is a new convenience protocol.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics