title: How to convert Objective-C BOOL to Swift's Bool with NSError** as one of the parameter in return
body: <p>I have a project in which I am trying to use Swift for the new modules. For one of the new class, I am using an existing method of an Objective-C class in Swift 3.2. </p>
  
  <p>Following is the signature of the method,</p>
  
  <pre><code>- (BOOL)canLoginWithUsername:(NSString *)username password:(NSString *)password error:(NSError **)error
  </code></pre>
  
  <p>I am trying to use this method in swift as,</p>
  
  <pre><code>    if try loginLogicHandler.canLogin(withUsername: usernameValue, password: passwordValue) as Bool {
  
  }
  </code></pre>
  
  <p>However, I am getting a compiler error as</p>
  
  <blockquote>
    <p>Cannot convert value of type () to type 'Bool' in coercion</p>
  </blockquote>
  
  <p>What should I do to make this working?</p>
  
  <p>Could anyone suggest how to fix this?</p>