title: How to make method wait for a response in order to return a value?
body: <p>I am sure this has been asked before, but I don't know the keywords to search for it.</p>
  
  <p>Suppose that I have a function <code>validateConnection</code> that returns a <code>bool</code>. This function makes a call to the server (using anetworking) and returns <code>true</code> if the request was successful (this is just a example).</p>
  
  <p>I want my method to wait until the response is back in order to return the <code>bool</code>: how to achieve that? </p>
  
  <p>Any help would be much appreciated!</p>