title: Swift computed property return value
body: <p>I have a computed property that is expected to return an object or nil if it fails.</p>
  
  <pre><code>var findRequest: Book {
      get {
          var foundRequest: Book!
          API.requestBook(book: bookRequest) { book in
              if book != nil {
                  foundRequest = book!
              } else {
                  print("Could not find book")
                  foundRequest = nil
              }
          }
          return foundRequest
      }
  }
  </code></pre>
  
  <p>When I run the code I get an unexpectedly found nil while unwrapping an Optional value error on the return foundRequest line. It looks like the code skips my closure function and goes straight to the return.</p>
  
  <p>Thanks</p>