ToastifySwift is an elegant SwiftUI library designed for creating customizable toast notifications and alerts. This library works seamlessly across multiple platforms, including iOS, macOS, watchOS, and tvOS. With its forward-thinking design, ToastifySwift is ready to support future platforms like VisionOS.
- Toast Notifications: Display messages with optional icons, colors, and auto-dismiss timers.
- Custom Alerts: Create alerts with two buttons for user interaction (e.g., Yes/No, Continue/Cancel).
- Fully Customizable: Adjust colors, durations, and backgrounds to fit your app's theme.
- Reusability: Designed for easy integration into any SwiftUI project.
- Cross-Platform: Compatible with iOS, macOS, watchOS, and tvOS.
To add ToastifySwift to your project using Swift Package Manager, follow these steps:
- Open your Xcode project.
- Navigate to File > Swift Packages > Add Package Dependency.
- Enter the following URL:
https://github.com/RJIOSDEV/ToastifySwift
Alternatively, you can add it directly to your Package.swift
file:
.package(url: "https://github.com/RJIOSDEV/ToastifySwift", from: "1.0.0")
If you prefer to install ToastifySwift manually, you can clone the repository:
git clone https://github.com/RJIOSDEV/ToastifySwift.git
Then, drag the ToastifySwift
folder into your Xcode project.
To get started with ToastifySwift, import the library in your SwiftUI view:
import ToastifySwift
To display a toast notification, use the following code snippet:
ToastView(message: "Your message here", duration: 2.0)
To create a custom alert, you can use:
CustomAlert(title: "Alert Title", message: "Alert message goes here.", confirmButtonTitle: "OK", cancelButtonTitle: "Cancel")
You can customize the appearance of your toasts and alerts. For example:
ToastView(message: "Your message here", backgroundColor: .blue, textColor: .white)
ToastifySwift is built to function across all supported platforms. Ensure you test your implementation on each platform for optimal performance.
Contributions are welcome! If you have suggestions for improvements or new features, please open an issue or submit a pull request. Make sure to follow the coding standards and guidelines in the repository.
- Fork the repository.
- Create a new branch for your feature or fix.
- Make your changes.
- Test your changes thoroughly.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For more information, visit the Releases section to download the latest version.
You can also check the Releases section for updates and changelogs.
- cross-platform
- custom-alert
- developer-tools
- ios-library
- spm
- swift
- swiftpm
- swiftui
- toast
- toast-notifications
If you encounter any issues or have questions, please open an issue in the repository. We aim to respond promptly and assist you with any concerns.
Thank you to all contributors and the Swift community for your support. Your feedback and contributions help improve this library.
This README provides a comprehensive overview of the ToastifySwift library, its features, and how to use it effectively in your projects.