Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philippeweidmann/notificationtoast
Google toast the Apple way !
https://github.com/philippeweidmann/notificationtoast
ios swift toast ui uikit
Last synced: 7 days ago
JSON representation
Google toast the Apple way !
- Host: GitHub
- URL: https://github.com/philippeweidmann/notificationtoast
- Owner: PhilippeWeidmann
- License: mit
- Created: 2020-12-20T12:21:45.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-05T09:21:02.000Z (4 months ago)
- Last Synced: 2024-12-13T23:09:02.017Z (14 days ago)
- Topics: ios, swift, toast, ui, uikit
- Language: Swift
- Homepage:
- Size: 440 KB
- Stars: 160
- Watchers: 5
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NotificationToast
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FPhilippeWeidmann%2FNotificationToast%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/PhilippeWeidmann/NotificationToast)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FPhilippeWeidmann%2FNotificationToast%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/PhilippeWeidmann/NotificationToast)A view that tries to replicate iOS default toast message view.
| Title | Icon | Subtitle |
| ------------- | ------------- | ------------- |
| ![Title](./Screenshots/title.png) | ![Icon](./Screenshots/icon.png) | ![Subtitle](./Screenshots/subtitle.png) |# Usage
Add this lib to your project using SPM or Cocoapods.To get the simple "Apple look" you only have to do this:
```swift
import NotificationToastlet toast = ToastView(title: "Safari pasted from Notes")
toast.show()
```
The view also includes many optional customizable properties:
```swift
let toast = ToastView(
title: "Airpods Pro",
titleFont: .systemFont(ofSize: 13, weight: .regular),
subtitle: "Connected",
subtitleFont: .systemFont(ofSize: 11, weight: .light),
icon: UIImage(systemName: "airpodspro"),
iconSpacing: 16,
position: .bottom,
onTap: { print("Tapped!") }
)
toast.show()
```
You can present the view with a haptic feedback at the same time (`nil` by default) :
```swift
toast.show(haptic: .success)
```# Contribute
As this is my first 'UI' package I'm sure it can be greatly improved, PR are welcome 😊# Alternatives
Drops 💧: https://github.com/omaralbeik/Drops
Bauly : https://github.com/wiencheck/Bauly