SystemNotification is a SwiftUI SDK that lets you mimic the native iOS system notification that are presented when you toggle silent mode, connect your AirPods, etc.
The result can look like this, or completely different:
These notifications can be styled and customized to great extent. You can also use completely custom views.
SystemNotification can be installed with the Swift Package Manager:
https://github.com/danielsaidi/SystemNotification.git
After adding SystemNotification to your project, you can add a system notification to a view hierarchy just as you add a sheet
, alert
and fullScreenModal
:
import SystemNotification
struct MyView: View {
var body: some View {
Text("Hello, world")
.systemNotification(...)
}
}
You can use both state- and context and message-based notifications and style your notifications to great extent.
For more information, please see the getting started guide.
The online documentation has more information, articles, code examples, etc.
The demo app lets you explore the library with iOS, macOS, and visionOS. To try it out, just open and run the Demo
project.
You can sponsor me on GitHub Sponsors or reach out for paid support, to help support my open-source projects.
Your support makes it possible for me to put more work into these projects and make them the best they can be.
Feel free to reach out if you have questions or if you want to contribute in any way:
- Website: danielsaidi.com
- Mastodon: @[email protected]
- Twitter: @danielsaidi
- E-mail: [email protected]
SystemNotification is available under the MIT license. See the LICENSE file for more info.