TWAlertView 0.1.4

TWAlertView 0.1.4

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jun 2016

Maintained by Tulakshana.



  • By
  • tulakshana

This pod is inspired by UIAlertController. TWAlertView will automatically recognise the top most view controller to display the alert, making showing a simple alert a hazzel free task.

Usage

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
    [TWAlertView showAlert:@"Hello" message:@"What do you like to do today?" buttonsArray:[NSArray arrayWithObjects:@"Socialise",@"Code", nil] callback:^(NSError *error, int buttonIndex) {
        if (error) {
            NSLog(@"%@",error.debugDescription);
        }else{
            switch (buttonIndex) {
            case 0:
                [self socialise];
                break;
            case 1:
                [self code];
                break;
            default:
                break;
            }
        }
    }];


    return YES;
}

- (void)socialise{
    [TWAlertView showAlert:@"Warning!" message:@"Are you sure you want to compromise your valuable time?"];
}

- (void)code{
    [TWAlertView showAlert:@"Nice!" message:@"Good choice buddy"];
}

Installation

TWAlertView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'TWAlertView', '0.1.3'

License

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

Todo

  • Support action sheet style