rjiosdev/toastifyswift
Elegant SwiftUI library for customizable **Toast Notifications** and **Custom Alerts**
πΈ Demo
[ToastifySwift Demo]
β¨ Features
- β Show toasts with message, icon, color, and auto-dismiss timer
- β Custom alerts with two buttons (e.g., Yes/No, Continue/Cancel)
- β Fully customizable appearance (colors, duration, background)
- β Designed for reusability β use in any SwiftUI project
- β Cross-platform ready (iOS, macOS, watchOS, tvOS)
π¦ Installation (Swift Package Manager)
Add this URL to Xcode: https://github.com/RJIOSDEV/ToastifySwift
Or in Package.swift:
.package(url: "https://github.com/RJIOSDEV/ToastifySwift", from: "1.0.0")
##
Or COCOAPODS
pod 'ToastifySwift', '~> 1.0.3'
---π§βπ» Usage
Show a Toast
@StateObject var toastManager = ToastManager()
.toastify(using: toastManager)
toastManager.show(toast: ToastModel(
message: "Saved successfully!",
icon: "checkmark.circle.fill",
backgroundColor: .green,
duration: 2.5
))
.customAlert(
isPresented: $showStandardAlert,
title: "Standard Alert",
message: "This is a standard alert.",
primary: AlertActionButton(title: "OK", background: .blue) {
// Your action
},
secondary: AlertActionButton(title: "Cancel", background: .gray) {
// Your action
},
style: .normal // Only .normal remains
)
---π Documentation
ToastManager
A shared ObservableObject that triggers toast messages globally.
@StateObject var toastManager = ToastManager()Package Metadata
Repository: rjiosdev/toastifyswift
Default branch: main
README: README.md