title: Display an alert on Swipe Delete in iOS
body: <p>I'm a beginner in iOS. I'm performing a swipe delete option. I want to display an alert view before deleting the row. How can i perform this action. </p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView commitEditingStyle:
    (UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  {
  NSLog(@"%@",collisionsArray);
  if (editingStyle == UITableViewCellEditingStyleDelete)
  {       
    NSUserDefaults *userinfo = [NSUserDefaults standardUserDefaults];
    NSString *userId = [userinfo valueForKey:@"user_id"];
    if(userId!=nil)
    {
    NSDictionary* dict = [collisionsArray objectAtIndex:indexPath.section];
    collisionId = [NSString stringWithFormat:@"%@",[dict valueForKey:@"collisionId"]];
    NSLog(@"%@",collisionId);
  // removes saved datas from database
    BOOL result =  [database removeCollisionDetails:collisionId:@"accident_report"];
      if(result)
      {  
      [[SHKActivityIndicator currentIndicator] 
      displayCompleted:NSLocalizedString(@"val_sucess_vehicle", nil)];
      [self.navigationController popViewControllerAnimated:YES];
      }
      else
      {
      [[SHKActivityIndicator currentIndicator]
      displayCompleted:NSLocalizedString(@"val_error", nil)];
      }
    }
  }
  [self.tableView reloadData];
  }
  </code></pre>