Advertisement
thieumao

ActionSheet

May 9th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import "ViewController.h"
  2.  
  3. @interface ViewController ()
  4.  
  5. @end
  6.  
  7. @implementation ViewController
  8.  
  9. - (void)viewDidLoad {
  10.     [super viewDidLoad];
  11.     // Do any additional setup after loading the view, typically from a nib.
  12. }
  13.  
  14. - (void)didReceiveMemoryWarning {
  15.     [super didReceiveMemoryWarning];
  16.     // Dispose of any resources that can be recreated.
  17. }
  18.  
  19. - (IBAction)ClickHere:(id)sender {
  20.     UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Lac Hong University" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Thieu Mao", @"Mot Mao", nil];
  21.     NSLog(@"%i",actionSheet.numberOfButtons);
  22.     [actionSheet showInView:self.view];
  23. }
  24.  
  25. -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
  26.     NSLog(@"Content: %@", [actionSheet buttonTitleAtIndex:buttonIndex]);
  27. }
  28. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement