title: Keyboard hide and show again right after UIActionSheet dismiss in iOS 7, SDK 7
body: <p>I create an <strong>UIActionSheet</strong> in my ViewController. I also add code to catch <strong>UIKeyboardWillShowNotification</strong> and <strong>UIKeyboardWillHideNotification</strong> notification. </p>
  
  <p>My problem is <strong>when I dismiss, I get two notification keyboard hide and show again</strong>.
  Somebody can show me how to prevent that problem ? It only happen in iOS 7 and build with SDK 7</p>
  
  <p><strong>Update some code:</strong></p>
  
  <p>In viewDidLoad, I init a button, when touch button, action sheet will be showed.</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      UIButton* button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
      button.frame = CGRectMake(10, 50, 100, 30);
      [button setTitle:@"Open menu" forState:UIControlStateNormal];
      [button addTarget:self action:@selector(buttonTouched) forControlEvents:UIControlEventTouchUpInside];
      [self.view addSubview:button];
  
      UITextView* textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
      [self.view addSubview:textView];
      [textView becomeFirstResponder];
  
      [[NSNotificationCenter defaultCenter] addObserver:self
                                               selector:@selector(keyboardWillHide:)
                                                   name:UIKeyboardWillHideNotification
                                                 object:nil];
  
      [[NSNotificationCenter defaultCenter] addObserver:self
                                               selector:@selector(keyboardWillShow:)
                                                   name:UIKeyboardWillShowNotification
                                                 object:nil];
  }
  
  - (void)searchBarCancelButtonClicked:(UISearchBar *) searchBar{
      [searchBar resignFirstResponder];
  }
  
  - (void) buttonTouched{
      UIActionSheet* actionSheet = [[UIActionSheet alloc] initWithTitle:@"Action sheet" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Destructive" otherButtonTitles:@"Hello", nil];
      [actionSheet showInView:self.view];
  }
  
  - (void)keyboardWillShow:(NSNotification*)notification{
      NSLog(@"keyboardWillShow");
  }
  
  - (void)keyboardWillHide:(NSNotification*)notification{
      NSLog(@"keyboardWillHide");
  }
  </code></pre>
  
  <p>I run app, keyboard will showed, I touch button, action sheet showed. I dismiss action sheet by touch any button on it, and Log print :</p>
  
  <blockquote>
    <p>keyboardWillShow</p>
    
    <p>keyboardWillHide</p>
    
    <p>keyboardWillShow</p>
  </blockquote>