Latest 0.0.1
Homepage https://github.com/1ilI/Y_ShowAlert
License MIT
Platforms ios 9.0
Frameworks UIKit
Authors

对 UIAlertController 的扩展,快速创建与展示 AlertController

功能

快速创建与展示 AlertController,包括含有 TextField 的 Alert

使用 Observer 监听了添加的 TextField ,方便做输入内容 最大、最小长度的限制,以及确认按钮的 enabled 状态等

使用

  • 普通的 Alert
    
    NSArray *actionTitle = @[@"取消",@"确认"];
    UIAlertController *alert = [UIAlertController alertWithTitle:@"标题 Title 🙃" message:@"消息 Message " actionsTitleArr:actionTitle alertAction:^(NSInteger actionIdx, UIAlertController *alertController) {

}];
[alert showAlert];


* 带有 TextField 的 Alert
```objc
NSArray *actionTitle = @[@"取消",@"确认"];
UIAlertController *alert = [UIAlertController alertWithTitle:@"标题 Title 🙃" message:@"消息 Message " actionsTitleArr:actionTitle alertAction:^(NSInteger actionIdx, UIAlertController *alertController) {

}];

[alert addTextFieldWithConfiguration:^(UITextField *textFieldConf) {

} observerTextFieldChanged:^(UITextField *textFieldObserver) {

}];

[alert showAlert];

Example

show

详细使用参见 Example

Latest podspec

{
    "name": "Y_ShowAlert",
    "version": "0.0.1",
    "summary": "u5bf9 UIAlertController u7684u6269u5c55uff0cu5febu901fu521bu5efau4e0eu5c55u793a AlertController",
    "description": "u5febu901fu521bu5efau4e0eu5c55u793a AlertControlleruff0cu5305u62ecu542bu6709 TextField u7684 Alertnu4f7fu7528 Observer u76d1u542cu4e86u6dfbu52a0u7684 TextField uff0cu65b9u4fbfu505au8f93u5165u5185u5bb9 u6700u5927u3001u6700u5c0fu957fu5ea6u7684u9650u5236uff0cu4ee5u53cau786eu8ba4u6309u94aeu7684 enabled u72b6u6001u7b49",
    "homepage": "https://github.com/1ilI/Y_ShowAlert",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "1ilI": "1ilI"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/1ilI/Y_ShowAlert.git",
        "tag": "0.0.1"
    },
    "source_files": [
        "Y_ShowAlert",
        "Y_ShowAlert/**/*.{h,m}"
    ],
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This