SystemNotification
About SystemNotification
SystemNotification
is a SwiftUI
library that lets you mimic the native iOS system notification that for instance is presented when toggling silent mode on and off.
The result can look like this…or completely different:
These notifications have a default style, but can be customized to fit your specific app.
Installation
Swift Package Manager
https://github.com/danielsaidi/SystemNotification.git
CocoaPods
pod SystemNotification
Getting started
SystemNotification lets you present any SwiftUI view as iOS system notifications, which are the ones that appear from the top when you e.g. toggle Silent Mode or connect your AirPods.
System notifications are added just as you add a sheet
, alert
and fullScreenModal
:
YourView()
.systemNotification(...)
You can either add a view- or context-based system notification.
Documentation
The SystemNotification documentation contains extensive information, code examples etc. and makes it easy to overview the various parts of the library.
You can either download the documentation or build it directly in Xcode, using Product/Build Documentation
.
Demo app
This repo contains a basic demo app that demonstrates how to use the bottom sheet.
Just open the Demo
project and run the app.
Contact me
Feel free to reach out if you have questions or if you want to contribute to this project in any way:
- E-mail: [email protected]
- Twitter: @danielsaidi
- Web site: danielsaidi.com
Sponsor my work
You can support my work by becoming a GitHub Sponsor.
License
SystemNotification is available under the MIT license. See the LICENSE file for more info.