SwiftEasyPop
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.
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.
Author: tunahancelik
Source Code: https://github.com/tunahancelik/SwiftEasyPop
License: MIT license