Tutorial details

AlertView With Action Buttons | App Code for Sale | Preview

AlertView With Action Buttons | iOS Tutorial

How to display alert views

Overview PAGE TOP

Reference: http://www.geekylemon.com/WEBPROTECT-xcodetutorialalertact.htm

In this tutorial i will show you how to display alert views

Features:

  • 1 Round rect button

this is useful for showing information and helping the user be directed with a button all from an alert view

ViewController.h PAGE TOP

@interface ViewController :UIViewController {
}
 -(IBAction)alert;
@end

ViewController.m PAGE TOP

@implementation ViewController
-(IBAction)alert {
UIAlertView *alert = [[UIAlertView alloc] 
initWithTitle:@"The Title"
message:@"The Message"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Button1",@"Button2",@"Button3", nil];
    [alert show];
}
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
        [[UIApplication sharedApplication]
openURL:[NSURL URLWithString:@"http://www.geekylemon.com"]];
    }
if (buttonIndex == 2) {
        [[UIApplication sharedApplication]
openURL:[NSURL URLWithString:@"http://www.youtube.com/geekylemon"]];
    }
if (buttonIndex == 3) {
        [[UIApplication sharedApplication]
openURL:[NSURLURLWithString:@"http://www.facebook.com/geekylemondevelopment"]];
    }
}
@end

Reference PAGE TOP

http://www.geekylemon.com/WEBPROTECT-xcodetutorialalertact.htm

0 Comments Leave a comment

Please login in order to leave a comment.

Newest first
!

Sign-in to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.