Latest 0.0.1
Homepage https://github.com/CancerQ/YZAlertController
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit, CoreFoundation
Authors

Harness the UIAlertController with a simplified, chainable and expressive syntax.

Demo Project

See Demo/YZAlertControllerDemo.xcodeproj

Installation

CocoaPods

  1. Add pod 'YZAlertController' to your Podfile.
  2. Run pod install or pod update.
  3. Import <YZAlertController/YZAlertController.h>.

Carthage

  1. Add github "CancerQ/YZAlertController" to your Cartfile.
  2. Run carthage update --platform ios and add the framework to your project.
  3. Import <YZAlertController/YZAlertController.h>.

Manually

  1. Download all the files in the YYKit subdirectory.
  2. Add the source files to your Xcode project.
  3. Link with required frameworks:
    • UIKit
    • CoreFoundation

Requirements

This library requires iOS 8.0+ and Xcode 9.0.

Usage

Heres the same UIAlertController created using YZAlertController


    [[[[[[YZAlertController.title(@"title").message(@"message").preferredStyle(UIAlertControllerStyleAlert)
          addAction:nil](@"Action1", UIAlertActionStyleDestructive)
         addAction:nil](@"Action2", UIAlertActionStyleDefault)
        addAction:^(UIAlertAction *action) {
            NSLog(@"action title is:%@",action.title);
        }](@"Action", UIAlertActionStyleCancel)
       addTextFieldWithConfigurationHandler:^(UITextField *textField) {
           textField.placeholder = @"textField";
       }]addTextFieldWithConfigurationHandler:^(UITextField *textField) {
           textField.placeholder = @"textField";
       }]addTextFieldWithConfigurationHandler:^(UITextField *textField) {
           textField.placeholder = @"textField";
       }].showOnCtr(ctr);

License

YZAlertController is provided under the MIT license. See LICENSE file for details.

中文介绍

YZAlertController 是将UIAlertController使用简化的、可链接的和表达性的语法来封装利用。

演示项目

查看并运行 Demo/YZAlertControllerDemo.xcodeproj

安装

CocoaPods

  1. 在 Podfile 中添加 pod 'YZAlertController'
  2. 执行 pod installpod update
  3. 导入 <YZAlertController/YZAlertController.h>。

Carthage

  1. 在 Cartfile 中添加 github "CancerQ/YZAlertController"
  2. 执行 carthage update --platform ios 并将生成的 framework 添加到你的工程。
  3. 导入 <YZAlertController/YZAlertController.h>。

手动安装

  1. 下载 YZAlertController 文件夹内的所有内容。
  2. 将 YZAlertController 内的源文件添加(拖放)到你的工程。
  3. 链接以下 frameworks:
    • UIKit
    • CoreFoundation

系统要求

该项目最低支持 iOS 8.0Xcode 9.0

用法

使用YZAlertController创建一个相同的UIAlerController


    [[[[[[YZAlertController.title(@"title").message(@"message").preferredStyle(UIAlertControllerStyleAlert)
          addAction:nil](@"Action1", UIAlertActionStyleDestructive)
         addAction:nil](@"Action2", UIAlertActionStyleDefault)
        addAction:^(UIAlertAction *action) {
            NSLog(@"action title is:%@",action.title);
        }](@"Action", UIAlertActionStyleCancel)
       addTextFieldWithConfigurationHandler:^(UITextField *textField) {
           textField.placeholder = @"textField";
       }]addTextFieldWithConfigurationHandler:^(UITextField *textField) {
           textField.placeholder = @"textField";
       }]addTextFieldWithConfigurationHandler:^(UITextField *textField) {
           textField.placeholder = @"textField";
       }].showOnCtr(ctr);

许可证

YZAlertController 使用 MIT 许可证,详情见 LICENSE 文件。

Latest podspec

{
    "name": "YZAlertController",
    "summary": "Harness the YZAlertController with a simplified, chainable and expressive syntax.",
    "version": "0.0.1",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "CancerQ": "[email protected]"
    },
    "social_media_url": "https://github.com/CancerQ",
    "homepage": "https://github.com/CancerQ/YZAlertController",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/CancerQ/YZAlertController.git",
        "tag": "0.0.1"
    },
    "requires_arc": true,
    "source_files": "YZAlertController/*.{h,m}",
    "frameworks": [
        "UIKit",
        "CoreFoundation"
    ]
}

Pin It on Pinterest

Share This