Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heyjaywilson/coffeetoast
A swift package to easily add Toast notifications to your app
https://github.com/heyjaywilson/coffeetoast
Last synced: 11 days ago
JSON representation
A swift package to easily add Toast notifications to your app
- Host: GitHub
- URL: https://github.com/heyjaywilson/coffeetoast
- Owner: heyjaywilson
- License: mit
- Created: 2022-02-02T03:20:19.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-04T13:55:00.000Z (almost 3 years ago)
- Last Synced: 2024-05-02T01:05:36.720Z (7 months ago)
- Language: Swift
- Size: 23.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# CoffeeToast
![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/maeganwilson/coffeetoast?include_prereleases) ![Open Issues](https://img.shields.io/github/issues/maeganwilson/coffeetoast) [![Swift](https://github.com/maeganwilson/CoffeeToast/actions/workflows/swift.yml/badge.svg)](https://github.com/maeganwilson/CoffeeToast/actions/workflows/swift.yml)
A simple Swift package to add Toast Notifications to your app. Install with the Swift Package Manager.
This package uses SwiftUI and requires a target of iOS 15.0. This means that the package isn't macOS compatible yet. It's planned for a future release.
## How to Use
Use the toast view by adding the view which presents the toast, see example below:
```swift
import SwiftUI
import CoffeeToaststruct ContentView: View {
@State private var toastIsShown = false
var body: some View {
Toast("TOAST NOTIFICATION", isShown: $toastIsShown) {
Button("Toggle Toast") {
toastIsShown = true
}
}
}
}
```## v1 Configuration options
- Background Color
- Text
- Duration
- Foreground Color (AKA Text Color)
- Content view