Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 CoffeeToast

struct 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