Latest 1.2.1
Homepage https://github.com/shashankpali/ATZAlertController
License MIT
Platforms ios 8.0, requires ARC
Authors

ATZAlertController helps you to create an alert from any class without any dependency on ViewController. The name itself derives that it provides A to Z solution towards the UIAlertController with various types of functions you can use them accordingly. ATZAlertController is easy to use and implement.

Pod Installation

CocoaPods is the preferred way to install this library. Add this command to your Podfile:


pod 'ATZAlertController'

For Objective C.

Direct Installation

Download .zip file and extract it. There you will find the ATZAlertController folder, copy all the files from the folder to your respective project.

Integration Method


 ATZAlertController.alertWithTitle("My Alert",
                          message: "Array containing object as 'String'",
                cancelButtonTitle: "Cancel",
           destructiveButtonTitle: "Remove",
                otherButtonTitles: ["Ok","Right"],
                   preferredStyle: .Alert,
               showAlertInstantly: true,
                          handler: { (action, titleString) in

                                      if(titleString == "Cancel")
                                      {
                                        print("(action.title)")
                                      }
                                      if(titleString == "Remove")
                                      {
                                        print("(action.title)")
                                      }
                                      if(titleString == "Ok")
                                      {
                                        print("(action.title)")
                                      }
                                      if(titleString == "Right")
                                      {
                                        print("(action.title)")
                                      }
                                    })
let button1 = ATZActionButton.actionWithTitleAndPrefferedStyle("Ok", style: .Default)
let button2 = ATZActionButton.actionWithTitleAndPrefferedStyle("Remove", style: .Destructive)

alert = ATZAlertController.alertWithTitle("My Alert",
                                  message: "Array containing object ATZActionButton",
                        cancelButtonTitle: "Cancel",
                        otherActionButton: [button1, button2],
                           preferredStyle: .Alert,
                       showAlertInstantly: false,
                                  handler: { (action, titleString) in

                                              if(titleString == "Cancel")
                                              {
                                                print("(action.title)")
                                              }
                                              if(titleString == "Remove")
                                              {
                                                print("(action.title)")
                                              }
                                              if(titleString == "Ok")
                                              {
                                                print("(action.title)")
                                              }
                                            })
alert.showWithAnimation(false)
ATZAlertController.loginAlertWithTitle("Login Alert",
                                message: "All fields are mandatory",
               userNamePlaceholderTitle: "Username",
               passwordPlaceholderTitle: "Password",
                     showAlertInstantly: true,
                                handler: { (action, titleString) in

                                            if(titleString == "Login")
                                            {
                                              print("(alert.textFields![0].text) n (alert.textFields![1].text)")
                                            }
                                            if(titleString == "Cancel")
                                            {
                                              print("(action.title)")
                                            }
                                          })

Thanks

License

ATZAlertController is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ATZAlertController",
    "version": "1.2.1",
    "platforms": {
        "ios": "8.0"
    },
    "license": {
        "type": "MIT"
    },
    "homepage": "https://github.com/shashankpali/ATZAlertController",
    "authors": {
        "Shashank Pali": "[email protected]"
    },
    "summary": "Show alert without dependency on ViewController",
    "source": {
        "git": "https://github.com/shashankpali/ATZAlertController.git",
        "tag": "1.2.1"
    },
    "requires_arc": true,
    "source_files": "ATZAlertController/*.{swift}"
}

Pin It on Pinterest

Share This