A lightweight, modern toast notification library for iOS. Works with both UIKit and SwiftUI. Built for iOS 15+.
- Dual API — SwiftUI modifier + UIKit manager
- Slide & Fade — Two animation styles out of the box
- Top or Bottom — Position toasts where you want them
- Smart Queue — Multiple toasts display one at a time
- 5 Styles — Success, error, warning, info, message
- Swipe to Dismiss — Natural gesture support
- Haptic Feedback — Configurable tactile response
- Custom Colours — Override backgrounds and text
- Thread Safe — Call from any thread
- Accessibility — VoiceOver ready
Xcode: File → Swift Packages → Add Package Dependency
https://github.com/aarons2222/Toastie
Package.swift:
dependencies: [
.package(url: "https://github.com/aarons2222/Toastie", from: "2.0.0")
]import SwiftUI
import Toastie
struct ContentView: View {
@State private var toast: Toastie?
var body: some View {
VStack(spacing: 20) {
Button("Success") {
toast = Toastie(
type: .success,
title: "Done!",
message: "Your changes have been saved."
)
}
Button("Error") {
toast = Toastie(
type: .error,
title: "Error",
message: "Something went wrong."
)
}
}
.toastieView(toast: $toast)
}
}import UIKit
import Toastie
class ViewController: UIViewController {
@IBAction func showToast(_ sender: UIButton) {
ToastieManager.showToastie(
type: .success,
title: "Saved",
message: "Your profile has been updated.",
in: self
)
}
}| Style | Colour | Icon |
|---|---|---|
.success |
Green | ✓ Checkmark |
.error |
Red | ✕ X mark |
.warning |
Orange | ⚠ Triangle |
.info |
Blue | ℹ Info |
.message |
Blue | 💬 Bubble |
let config = ToastieConfiguration(
duration: 5.0, // Display time (default: 3s)
position: .bottom, // .top or .bottom (default: .top)
appearance: .slide, // .slide or .fade (default: .slide)
enableHapticFeedback: true, // Vibration (default: true)
backgroundColor: .purple, // Custom background
textColor: .white, // Custom text colour
enableSwipeToDismiss: true // Swipe gesture (default: true)
)
toast = Toastie(
type: .info,
title: "Custom",
message: "Fully configured toast.",
configuration: config
)Toastie supports two animation styles:
Slide (default) — Toasts slide in from the top or bottom edge with a spring animation.
let config = ToastieConfiguration(appearance: .slide)Fade — Toasts fade in and out.
let config = ToastieConfiguration(appearance: .fade)Fire multiple toasts — they'll display one at a time automatically:
for style in ToastieStyle.allCases {
toast = Toastie(type: style, title: "Queued", message: "Shows in order.")
}// Basic
ToastieManager.showToastie(type: .success, title: "Title", message: "Message", in: self)
// With config
ToastieManager.showToastie(type: .error, title: "Title", message: "Message", in: self, configuration: config)
// From model
let toast = Toastie(type: .warning, title: "Title", message: "Message")
ToastieManager.showToastie(toast: toast, in: self)
// Dismiss all
ToastieManager.dismissAll()The repo includes a ToastieDemo project with interactive controls for testing all styles, positions, animations, and configurations.
- iOS 15.0+
- Swift 5.7+
- Xcode 14+
MIT License — see LICENSE for details.
Made with ❤️ by Aaron Strickland