Skip to content

RJIOSDEV/ToastifySwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToastifySwift

Elegant SwiftUI library for customizable Toast Notifications and Custom Alerts
Works across iOS, macOS, watchOS, tvOS — and ready for the future (VisionOS, etc.)


ToastifySwift

Elegant SwiftUI library for customizable Toast Notifications and Custom Alerts
Works across iOS, macOS, watchOS, tvOS — and ready for the future (VisionOS, etc.)


📸 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

```swift
@StateObject var toastManager = ToastManager()

.toastify(using: toastManager)

toastManager.show(toast: ToastModel(
    message: "Saved successfully!",
    icon: "checkmark.circle.fill",
    backgroundColor: .green,
    duration: 2.5
))



---

## 📚 Documentation

### ToastManager

A shared `ObservableObject` that triggers toast messages globally.

```swift
@StateObject var toastManager = ToastManager()