CRToastSwift 1.0.0-alpha.2

CRToastSwift 1.0.0-alpha.2

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布上次发布2016年3月
SPM支持 SPM

Masahiko Tsujita 维护。



CRToastSwift 1.0.0-alpha.2

  • Masahiko Tsujita

CRToastSwift

这是 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 文件。