title: Unable to call method in Swift class that throws and has non-void return from Obj-C
body: <p>I want to have a function in Swift that returns a <code>Bool</code> but that can also <code>throw</code> if an exception occurs.  </p>
  
  <p>For example:</p>
  
  <pre><code> func doSomething(value: Int) throws -&gt; Bool {
      if (value &gt; 0) {
          return true
      } else if (value == 0) {
          throw NSError(domain: "SwiftClass", code: 0, userInfo: nil)
      }
      return false
  }
  </code></pre>
  
  <p>This works fine, from Swift, but if I try and use this function from Objective-C, the compiler can't find the method.  I know that the <code>throws</code> requires the Objective-C function signature to change to <code>doSomething:x error:&amp;error</code> and this works, if I change the return type to <code>Void</code> -</p>
  
  <pre><code>func doSomething(value: Int) throws -&gt; Void {
      if (value == 0) {
           throw NSError(domain: "SwiftClass", code: 0, userInfo: nil)
      } else if (value &lt; 0) {
          throw NSError(domain: "SwiftClass", code: -1, userInfo: nil)
      }
  }
  </code></pre>
  
  <p>But this has different semantics.  In the first example, I only need to deal with the exception (or non-nil <code>NSError</code>) if there is a problem.  With this code I have to catch the exception (or examine the error) and determine if it is a real problem or just the valid, "false" case.</p>
  
  <p>Is it really not possible to use a Swift function with a non-void return that throws in an Objective-C context?  </p>