RSBlurAlert 1.1.0

RSBlurAlert 1.1.0

Rohan Sanap维护。




RSBlurAlert

CI Status Version License Platform

示例

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

要求

安装

RSBlurAlert 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:

pod 'RSBlurAlert'

用法

在希望使用此提醒的文件中导入模块

import RSBlurAlert

然后初始化它并设置其属性。

let blurAlert = RSBlurAlertController()
blurAlert.alertTitle = "Attention"
blurAlert.alertDetail = "Describe the alert to the user using this so that user gets some idea."
blurAlert.alertImage = UIImage(named: "warning")

此外,您还可以使用各种自定义选项

• 如果需要,此属性可以帮助您将提醒保持可见特定时间(以秒为单位)。

blurAlert.alertVisibleTime = 5

• 此属性可以帮助您关闭自动隐藏功能。如果设置为false,则通过用户在屏幕上点击来关闭提醒。

blurAlert.autoHide = false

• 显示提醒与显示任何视图控制器一样简单。只需显示,无需动画。

present(blurAlert, animated: false, completion: nil)

图像大小:您想要使用的提醒图像应具有130 X 130的完美尺寸(@1x),并相应地缩放。如果您只能访问水平或垂直矩形的图像,不要担心,图像视图的内容模式是“适应宽高”,因此您的图像不会被裁剪。

注意:以上所提到的属性都不是强制性的或必需的。它们是可选的。默认设置已提供足够的功能。强烈建议下载代码库并查看示例项目。所有可能性和功能都在最简单的情况下进行了描述。

作者

Rohan Sanap,[email protected]

Twitter - @therohansanap

归属功劳

我开始学习如何创建可重用框架以及如何通过CocoaPods分发它们。我偶然发现了以下文章

这篇文章是我的想法的来源。我决定实现相同的UI,但使用完全不同的方法和大量的自定义功能,因此RSBlurAlert应运而生。

许可

RSBlurAlert根据MIT许可提供。有关更多信息,请参阅LICENSE文件。