MASCoolAlertView 0.1.0

MASCoolAlertView 0.1.0

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2017年10月
SwiftSwift版本3.0
支持支持SPM

Michael Abadi Santoso 维护。




  • abadikaka 和 Michael Abadi Santoso

MASCoolAlertView




描述

一个简单可定制的 Alert 视图且易于使用。
它提供了什么?

  • 自定义标题栏
  • 自定义页脚按钮
  • 自定义视图主体
  • 自定义关闭按钮

示例

要运行示例项目,首先从 GitHub 仓库克隆它,然后从 Example 目录运行 pod install

如何使用

初始化 MASCoolAlertView

self.newAlert = MASCoolAlertView(height: 200, width: 200, cornerRadius: 10, backgroundColor: .yellow)

添加到子视图

self.view.addSubview(newAlert!)

设置标题栏

self.newAlert!.setTitleBar(height: 50, backgroundColor: .green, titleColor: .blue, titleText: "Title Text")

设置标题栏边框

self.newAlert!.setTitleBarBorder(borderWidth: 1, borderColor: .red)

创建关闭按钮

self.newAlert!.createCloseButton(tintColor: .red, imageNamed: "close-circular.png", buttonSize: 24)

设置页脚按钮

self.newAlert!.setFooterButton(buttonText: "Close", buttonColor: .black, buttonTextColor: .red, height: 50)

设置自定义页脚按钮处理程序

self.newAlert!.handleBottomButton = handleButton

使用自定义主体设置主体视图

let newView = UIView(frame: CGRect(x: 10, y: self.newAlert!.topView!.bounds.maxY + 10, width: self.newAlert!.bounds.height - 20, height: self.newAlert!.bounds.height/3))
newView.backgroundColor = .blue

使用主体文本(默认)或使用上述自定义主体设置主体内容

self.newAlert!.setBodyContent(bodyBackgroundColor: .clear, bodyTextColor: .black, bodyText: "Hello This is Text Field", bodyView: nil)

使用延迟和选项效果(curveEaseIn、curveEaseOut、curveEaseInOut、specialCurve)显示alert

self.newAlert!.show(duration: 0.5, delay: 0.0, options: .curveEaseIn)

安装

MASCoolAlertView 可通过 CocoaPods 获取。要安装
它,只需将以下行添加到您的 Podfile

pod 'MASCoolAlertView'

作者

abadikaka,[email protected]
Michael Abadi Santoso,[email protected]

许可证

MASCoolAlertView 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。