SwiftEasyPop is a lightweight and easy-to-use SwiftUI library for displaying custom alerts and toasts in a Swift application. It provides a flexible way to present customizable alerts and toasts with minimal setup.
- 🚀 Simple and intuitive API for showing alerts and toasts.
- 🎨 Highly customizable, supporting custom icons, colors, and messages.
- 📱 Compatible with iOS 14.0+.
- 🔄 Supports both light and dark mode.
You can add SwiftEasyPop to your project via Swift Package Manager. Add the following dependency to your Package.swift
file:
dependencies: [
.package(url: "https://github.com/tunahancelik/SwiftEasyPop.git", from: "1.0.0")
]
Import SwiftEasyPop into your SwiftUI view and use the provided modifiers to present alerts and toasts.
import SwiftUI
import SwiftEasyPop
struct ContentView: View {
@State private var showAlert = false
@State private var showToast: EasyToastView? = nil
var body: some View {
// Your view code
}
}
// Use EasyAlertPop to show custom alerts
Button("Show Alert") {
showAlert = true
}
.easyAlertPop(presentAlert: $showAlert, alertType: .constant(.oneButton(...)))
// Use EasyToastView to show custom toasts
Button("Show Toast") {
showToast = EasyToastView(...)
}
.toastView(toast: $showToast)
SwiftEasyPop allows for extensive customization of alerts and toasts. You can set custom icons, messages, colors, and more.
Contributions are welcome! Please read the contribution guidelines first.
SwiftEasyPop is released under the MIT License.