Skip to content

A simple pod which could be used to show an alert in your iOS app.

License

Notifications You must be signed in to change notification settings

Tulakshana/TWAlertView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TWAlertView

Version License Platform

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'

License

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

Todo

  • Support action sheet style

About

A simple pod which could be used to show an alert in your iOS app.

Resources

License

Stars

Watchers

Forks

Packages

No packages published