JLToast is a lightweight and customizable toast notification library for iOS. It provides a simple and easy way to show non-obtrusive notifications to users.
Features
Customizable
- Easily customize the appearance and behavior of toast notifications to match your app’s design
- Choose from a variety of pre-defined styles or create your own
- Control duration, position, animation, and more
Lightweight
- Designed to be performance-efficient and add minimal overhead to your app
- Small library size with a focus on fast and efficient toast rendering
Easy Integration
- Simple to integrate into your iOS project
- Compatible with both Objective-C and Swift
- Supports iOS 10 and above
Accessibility
- Complies with accessibility standards to ensure a great user experience for all users
- Includes support for Dynamic Type and VoiceOver
Installation
CocoaPods
To install JLToast using CocoaPods, add the following line to your Podfile:
pod 'JLToast'
Carthage
To install JLToast using Carthage, add the following line to your Cartfile:
github "jlaws/JLToast"
Manual Installation
- Download the latest release from the GitHub repository
- Add the JLToast folder to your Xcode project
- Make sure to include the necessary frameworks: Foundation, UIKit, and CoreGraphics
Usage
Show a Toast
To show a toast notification, simply call the following method:
JLToast.makeText("Hello, JLToast!").show()
Customizing a Toast
You can customize various aspects of a toast, including text, duration, style, and more. Here’s an example of customizing a toast:
let toast = JLToast.makeText("Customized Toast")
toast.duration = 2.0 // Duration in seconds
toast.backgroundColor = .blue // Customize background color
toast.textInsets = UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16) // Add padding to text
toast.show()
Documentation
For detailed information on using JLToast, please refer to the official GitHub repository along with the wiki.
License
JLToast is available under the MIT license. See the LICENSE file for more information.