title: Dismissing the keyboard while simulating a wait
body: <p>This function is designed to simulate a wait if the user is successful logging in. As you can see I dismiss the keyboard first but that doesn't stop NSThread from sleeping before the keyboard is dismissed. I think I need to harness the power of the dispatch queue but not quite sure. Any way I can dismiss the keyboard before sleep occurs?</p>
  
  <pre><code>-(IBAction)userLoginButtonPressed:(id)sender
  {
      /* resign first responders so that the user
       can see the label of the server trying to log in */
      [self.usernameField resignFirstResponder];
      [self.passwordField resignFirstResponder];
      self.statusLabel.text = @"Logging In...";
  
      // create the server object and pass in the username and password values
      IONServer *server = [[IONServer alloc] init];
      NSString *user = self.usernameField.text;
      NSString *pw = self.passwordField.text;
      [server loggingInWithUserName:user password:pw];
  
      // redirect based on result
      if (server.result.success) {
          [self serverSuccess];
          [NSThread sleepForTimeInterval:2.0f];
      } else {
          [self serverFailure];
      }
  
      // store the server object as this class' server var
      self.server = server;
      NSLog(@"Result From Server: %@", server.result);
  }
  </code></pre>