# ZRAlertController **Repository Path**: VictorZhang2018/ZRAlertController ## Basic Information - **Project Name**: ZRAlertController - **Description**: A delightful alert view framework that being compatible with iOS 7.0 and later. It has the version both Objective-C and Swift. - **Primary Language**: Objective-C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-03-31 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ZRAlertController A delightful alert view framework that being compatible with iOS 7.0 and later. It has the version both Objective-C and Swift. [![Carthage Version](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/VictorZhang2014/ZRAlertController) [![Cocoapods Version](https://img.shields.io/cocoapods/v/ZRAlertController.svg?style=flat)](http://cocoapods.org/pods/ZRAlertController) [![License](https://img.shields.io/cocoapods/l/ZRAlertController.svg?style=flat)](http://cocoapods.org/pods/ZRAlertController) [![Platform](https://img.shields.io/cocoapods/p/ZRAlertController.svg?style=flat)](http://cocoapods.org/pods/ZRAlertController) How to install and get Started with CocoaPods ----------------------------------- ## CocoaPods ``` platform :ios, '7.0' pod 'ZRAlertController', '~> 2.3.3' ``` ### Carthage [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. You can install Carthage with [Homebrew](http://brew.sh/) using the following command: ```bash $ brew update $ brew install carthage ``` To integrate SnapKit into your Xcode project using Carthage, specify it in your `Cartfile`: ```ogdl github "VictorZhang2014/ZRAlertController" ~> 2.3.4 ``` Run `carthage update` to build the framework and drag the built `ZRAlertViewController.framework` into your Xcode project. ## Usage of first style `[[ZRAlertController defaultAlert] alertShowWithTitle:@"Note" message:@"This is an empty message!" okayButton:@"Ok"];` ### Effect Photo ![ZRAlertController Effect Photo 1](screenshots/one.png) ## Usage of second style ``` [[ZRAlertController defaultAlert] alertShowWithTitle:@"Note" message:@"This is an empty message!" cancelButton:@"Cancel" okayButton:@"Ok" okayHandler:^{ NSLog(@"You clicked the okay button."); } cancelHandler:^{ NSLog(@"You clicked the cancel button."); }]; ``` ### Effect Photo ![ZRAlertController Effect Photo 2](screenshots/two.png "ZRAlertController") ## Usage of third style ``` [[ZRAlertController defaultAlert] alertShowWithTitle:@"Note" message:@"This is an explanation message!" cancelButton:@"Cancel" okayButton:@"Okay" alertStyle:ZRAlertStyleSecureTextInput placeHolder:@"Type any character" okayHandler:^(UITextField *textFiled) { NSLog(@"Your input of textFiled is %@.", textFiled.text); } cancelHandler:^(UITextField *textFiled) { NSLog(@"Your input of textFiled is %@.", textFiled.text); }]; ``` ### Effect Photo ![ZRAlertController Effect Photo 3](screenshots/three.png "ZRAlertController") ## Usage of fourth style ``` [[ZRAlertController defaultAlert] alertShowWithTitle:@"Note" message:@"This is an explanation message!" cancelButton:@"Cancel" okayButton:@"Ok" alertStyle:ZRAlertStyleLoginAndPasswordInput placeHolder1:@"Type an account" placeHolder2:@"Type a passcode" sureHandler:^(UITextField *textFiled1, UITextField *textFiled2) { NSLog(@"Your input of Sure textFiled1.text = %@, textFiled2.text = %@. ", textFiled1.text, textFiled2.text); } abolishHandler:^(UITextField *textFiled1, UITextField *textFiled2) { NSLog(@"Your input of Abolish textFiled1.text = %@, textFiled2.text = %@. ", textFiled1.text, textFiled2.text); }]; ``` ### Effect Photo ![ZRAlertController Effect Photo 4](screenshots/four.png "ZRAlertController") ## Usage of first style action sheet ``` [[ZRAlertController defaultAlert] actionViewWithTitle:nil cancel:@"cancel" others:@[@"aaa",@"bbb",@"ccc"] handler:^(int index, NSString * _Nonnull item) { NSLog(@"index = %d, item = %@. ", index, item); }]; ``` ### Effect Photo ![ZRAlertController Effect Photo 1](screenshots/five.png "ZRAlertController")