Notie 1.0.4

Notie 1.0.4

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2015年12月
SPM支持 SPM

Maintained by Thi Doan, Thi Doan.



Notie 1.0.4

  • Doan Truong Thi

Notie

Swift,具有附加按钮和输入框的无干扰应用内通知。

安装

使用方法

示例

使用 Confirm 风格显示通知

let notie = Notie(view: self.view, message: "Are you sure you want to do that?", style: .Confirm)

notie.leftButtonAction = {
    // Add your left button action here
    notie.dismiss()
}

notie.rightButtonAction = {
    // Add your right button action here
    notie.dismiss()
}

notie.show()

参数

以下参数可以修改来自定义通知的显示样式。

  • style: 通知的样式。.Confirm 风格包括消息视图和两个确认按钮。 .Input 风格增加额外的输入文本字段。默认为 .Confirm

  • leftButtonAction: 用户点击左按钮时要调用的块。

  • rightButtonAction: 用户点击右按钮时要调用的块。

  • leftButtonTitle: 左按钮的标题。默认为 OK

  • rightButtonTitle: 右按钮的标题。默认为 Cancel

  • placeholder: 输入文本字段的占位符。默认为 nil

  • animationDuration: 向下滑动动画的持续时间。

  • messageBackgroundColor: 消息视图的背景颜色。

  • messageTextColor: 消息视图的文字颜色。默认为白色。

  • inputFieldBackgroundColor: 输入文本字段的背景颜色。默认为白色。

  • inputFieldTextColor: 输入文本字段的文字颜色。默认为深灰色。

  • leftButtonBackgroundColor: 左按钮的背景颜色。

  • leftButtonTextColor: 左按钮的文字颜色。默认为白色。

  • rightButtonBackgroundColor: 右按钮的背景颜色。

  • rightButtonTextColor: 右按钮的文字颜色。默认为白色。

要求

iOS 9 或更高版本。

许可证

Notie 在 MIT 许可证下发布。有关详细信息,请参阅 LICENSE。