title: hide the keyboard if action sheet is going to popup
body: <p>I have an app in which i have 2 textfield. Now my problem is, Let say first user taps on normal textfield. Which will popups keyboard. Then without selecting done button he taps on date field. Which will popup action sheet (without dismissing the keyboard). After hiding actionsheet user has to tap on other text filed and click on return key of the keyboard.</p>
  
  <p>I want to hide the keyboard if action sheet is going to popup?</p>
  
  <p>my code is below</p>
  
  <pre><code>- (void)textFieldDidBeginEditing:(UITextField *)textField
  {
  
  
      if([textField isEqual:txtdob])
      {
  
          [textField resignFirstResponder];
  
  
          actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
          [actionSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
         // txtdob.inputView=actionSheet;
          CGRect pickerFrame = CGRectMake(0, 40, 0, 0);
  
          datepicker=[[UIDatePicker alloc] initWithFrame:pickerFrame];
          datepicker.datePickerMode = UIDatePickerModeDate;
          //[datepicker setMinimumDate:minDate];
          [datepicker addTarget:self action:@selector(changeDateInLabel:) forControlEvents:UIControlEventValueChanged];
  
          [actionSheet addSubview:datepicker];
          [datepicker release];
  
          UISegmentedControl *closeButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObject:@"Done"]];
          closeButton.momentary = YES; 
          closeButton.frame = CGRectMake(260, 7.0f, 50.0f, 30.0f);
          closeButton.segmentedControlStyle = UISegmentedControlStyleBar;
          closeButton.tintColor = [UIColor blueColor];
          [closeButton addTarget:self action:@selector(dismissActionSheet) forControlEvents:UIControlEventValueChanged];
          [actionSheet addSubview:closeButton];
          [closeButton release];
  
          [actionSheet showInView:self.view];
  
          [actionSheet setBounds:CGRectMake(0, 0, 320, 485)];
  
      }
  }
  </code></pre>