Toasty
一个简单的接口,使用 Swift 编写的面向 iOS 的 toast 框架。
功能
- 一个 toast 是一个
Operation
对象,ToastCenter
使用操作队列管理所有 toast。 - 简单接口。
- 可自定义
- UIAccessibility:声音支持。
安装
iOS 9+
CocoaPods
pod 'Toasty-Swift'
入门
Toast(text: "hello toasty." ,position: .center, superView: self.view).show()
or
self.view.makeToast(text: "hello toasty.",position: .top)
您可以移除所有 toast
ToastCenter.default.cancelAll()
或者取消一个 toast
Toast(text: "hello toasty." ,position: .center, superView: self.view).cancel()
无障碍
默认情况下,启用带有 UIAccessibility 的 VoiceOver。要禁用它
ToastCenter.default.supportVisionAccessibility = false
许可证
更多信息请参阅 LICENSE 文件。