12/06/2014

simple ios alert - PKAlert

I built a simple class working as UIAertView in objective-c.

PKAlert - github.com (https://github.com/hakopako/PKAlert)

I hope it helps your app easily showing alert  !!!!!

Usage

  1. Add PKAlert.h,PKAlert.m to your project.
  2. #import "PKAlert.h"
  3. call method like so
```
//simpleAlert
[PKAlert showWithTitle:@"Notice" //NSString or nil
                  text:@"hogehogehoghoe\nhugahuga\nIs this ok?\n\n\nhahahaha" //NSString or nil
      cancelButtonText:@"O K" //NSString or nil
                 items:nil 
             tintColor:[UIColor colorWithRed:0.5 green:0.849 blue:0.9 alpha:1.000] //UIColor or nil
];
```
 
``` 
//optionAlert
[PKAlert showWithTitle:@"Success!!"
                  text:@"XXXX is completed successfuly.\n check ooooo now!"
      cancelButtonText:@"Cancel"
                 items:@[
                         [PKAlert generateButtonWithTitle:@"Bar" //backgoundColor button is generated.
                                                   action:^(){
                                                       NSLog(@"Bar is clicked.");
                                                   }
                                                     type:UIButtonTypeSystem
                                           backgoundColor:[UIColor colorWithRed:0.5 green:0.849 blue:0.9 alpha:1.000]],
                         [PKAlert generateButtonWithTitle:@"Foo" //tintColor button is generated.
                                                   action:^(){
                                                       NSLog(@"Foo is clicked.");
                                                   }
                                                     type:UIButtonTypeSystem]]
             tintColor:nil];
 ```