title: exctract code from handler to functions/methods obj C
body: <p>I need to extract code from</p>
  
  <pre class="lang-c prettyprint-override"><code>[NSURLConnection sendAsynchronousRequest:request
                                     queue:[NSOperationQueue mainQueue]
                         completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
                             [self doSomethingWithData:data];
                             outstandingRequests--;
                             if (outstandingRequests == 0) {
                                 [self doSomethingElse];
                             }
                         }];
  </code></pre>
  
  <p>to</p>
  
  <pre class="lang-c prettyprint-override"><code>void AsynchronousRequestCompletionHandler (NSURLResponse *response, NSData *data, NSError *error)
  {
    ...    
  }
  </code></pre>
  
  <p>but I can't:
  <img src="https://i.stack.imgur.com/42JKf.png" alt="enter image description here"></p>
  
  <p>in xamarin iOS i did it: instead this</p>
  
  <pre class="lang-cs prettyprint-override"><code>TextLogin.ShouldChangeCharacters += () =&gt; { some code...};
  </code></pre>
  
  <p>made this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>TextLogin.ShouldChangeCharacters += LoginAndPassValidator;
  
  // ... some code
  
  bool LoginAndPassValidator (UITextField textField, NSRange range, string replacementString)
  {
      BtnLogin.Enabled = (!String.IsNullOrWhiteSpace (TextLogin.Text)) &amp;&amp; (!String.IsNullOrEmpty (TextPass.Text));
      if (BtnLogin.Enabled) {
          BtnLogin.SetTitleColor (UIColor.Black, UIControlState.Normal);
      } else {
          BtnLogin.SetTitleColor (UIColor.Gray, UIControlState.Normal);
      }
      return true;
  }
  </code></pre>
  
  <p>Can I make this extraction in obj C?</p>