目录
- AADialogs
- 描述
- 演示
- 要求
- 安装
- CocoaPods
- Carthage
- 手动安装
- 入门
- 将您的对话框定义为UIViewController
- 显示您的对话框
- 在该视图控制器中隐藏您的对话框
- 具有自定义配置的方法签名
- 贡献 & 许可
#AADialogs
##描述
AADialogs - 在iOS中使用Storyboard处理自定义对话框的简单方法。
##演示
要运行示例项目,请克隆存储库,然后首先从Example目录中运行pod install
。
##要求
- iOS 9.0+
- Xcode 8.0+
- Swift 3+
安装
使用CocoaPods、Carthage或手动方式都可以安装AADialogs
。
##CocoaPods
AADialogs
通过CocoaPods提供。要安装CocoaPods,运行
$ gem install cocoapods
然后创建一个包含以下内容的Podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'AADialogs' , '1.0'
end
最后,运行以下命令来安装
$ pod install
##Carthage
要安装Carthage,运行(使用Homebrew)
$ brew update
$ brew install carthage
然后添加以下行到您的Cartfile
github "EngrAhsanAli/AADialogs" "master"
然后导入所有使用此库的文件的库中
import AADialogs
##手动安装
如果您不想使用上述提到的任何依赖管理器,您可以将AADialogs
手动集成到项目中,方法是将Classes文件夹中包含的文件添加到您的项目中。
##开始使用
##将您的对话框定义为UIViewController
let alertVC = UIStoryboard(name: #storyboard#, bundle: nil).instantiateViewController(withIdentifier: #withId#)
##显示您的对话框
alertVC.aa_show_alert()
##在该视图控制器中隐藏您的对话框
aa_hide_alert(animation: .zoomOut)
##具有自定义配置的方法签名
您可以使用以下属性
aa_show_alert(duration: TimeInterval,
springDamping: AAViewDamping,
animation: AAViewAnimators,
blurEffect: UIBlurEffectStyle?,
viewController: UIViewController?,
completion: ((Bool, UIViewController) -> ())?)
aa_hide_alert(duration: TimeInterval,
springDamping: AAViewDamping,
animation: AAViewAnimators,
completion: (() -> ())?)
##贡献与许可证
AADialogs
在MIT许可证下可用。有关更多信息,请参阅许可证文件。
AADialogs
使用AAViewAnimator
进行自定义视图动画。请在https://github.com/EngrAhsanAli/AAViewAnimator查看AAViewAnimator
。
欢迎提交Pull请求!最佳的贡献将包括替换或配置已知在正常应用程序生命周期中阻断主线程的类/方法。
如果您想在您的应用程序中使用AADialogs
,请通过Engr. Ahsan Ali发邮件给我