Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • UIActionSheet in objective c

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 375
    Comment on it

    We can show the action sheet by using following code. In the below code we displayed the action sheet on button action.

     

    - (IBAction)actionSheetButtonAction:(id)sender {
    
      UIAlertController *obj1=[UIAlertController alertControllerWithTitle:@"Options" message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];
    
     UIAlertAction *edit=[UIAlertAction actionWithTitle:@"Edit" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    
         //add code you want to perform when click on Edit
    
      }];
    
    UIAlertAction *delete=[UIAlertAction actionWithTitle:@"Delete" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    
      //add code you want to perform when click on Delete
    
       }];
    
      UIAlertAction *cancel=[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
    
        //add code you want to perform when click on Cancel
    
      }];
    
      [obj1 addAction:edit];
    
      [obj1 addAction:delete];
    
      [obj1 addAction:cancel];
    
     
      [self presentViewController:obj1 animated:YES completion:nil];
    
    }
    
    
    
    
    
    

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: