测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布上次发布 | 2016年3月 |
SPM支持 SPM | ✗ |
由 Masahiko Tsujita 维护。
这是 CRToast 的包装库。接口被重新设计以方便与 Swift 一起使用。
属性变得类型安全且更易于编写。您不再需要使用 Singleton。
创建 NotificationController
实例,配置属性,然后调用 present()
显示通知。
// Instantiate a notification controller
let notification = CRToastSwift.NotificationController(
title: "Hello!",
subtitle: "This is a subtitle text."
template: .Info)
// Configure notification attributes
notification.titleTextAlignment = .Center
notification.inAnimationType = .Gravity
notification.outAnimationType = .Gravity
notification.duration = 3.0
// Show a notification
notification.present()
CRToastSwift 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile 中:
pod "CRToastSwift"
CRToastSwift 提供 MIT 许可证。有关更多信息,请参阅 LICENSE 文件。