A lightweight toast library for iOS.
- iOS 11 or any higher version.
- Preferably Swift 5.0 or any higher version.
- The library has not been tested with Swift 4.x or any lower version.
- Display toast (Can contain small pictures) in one line code.
- Modify the toast content appeared on the screen easily.
The example project contains some usages of YuiToast. You can use and modify as your like.
Clone or download YuiToast first and run the following command:
cd YuiToast/Example
pod install
Then, open Example.xcworkspace.
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
gem install cocoapods
To integrate YuiToast into your Xcode project using CocoaPods, specify it in your Podfile:
platform :ios, '11.0'
target 'Your Project Name' do
use_frameworks!
# Pods for Your Project Name
pod 'YuiToast', '0.1.0'
end
Then, run the following command:
pod install
import YuiToast
Toast.default.show(message: "Hello World")
import YuiToast
Toast.default.show(message: "Toast With Image", image: UIImage(named: "DemoImage"))
import YuiToast
Toast.default.show(message: "Hello World", duration: .never) // never disappear
Toast.default.show(message: "Hello World", duration: .timeInterval(duration: 3)) // disappears after 3 seconds
func show(_ toastItem: ToastItem)
import YuiToast
let item = Toast.defaut.show(...)
Toast.default.update(item: item) { item in
item.title = "updated"
}
Copyright (c) 2020 Tao Juncheng
LICENSE file