title: Accessing Objective-C NSError** methods in Swift
body: <p>ObjC method: <code>-(id)objectFromData:(NSData *)data error:(NSError *__autoreleasing *)error</code></p>
  <p>Swift translated Method: <code>func object(from data: Data!) throws -&gt; Any</code></p>
  <p>I am calling this translated func VIA do try Catch in swift. objC implementation of 'objectFromData' is</p>
  <pre><code>    -(id)objectFromData:(NSData *)data error:(NSError *__autoreleasing *)error
      {
          *error = [NSError errorWithText:@&quot;Unable to get Data, Please try later&quot;];
          return @&quot;testing&quot;;
      }
  </code></pre>
  <p>I am accessing like</p>
  <pre><code>let objCVar : ParserBase = ParserBase()
  do {
      try objCVar.object(from: data)
  } catch {
      print(&quot;Catched ObjC Error&quot;)
  }
  </code></pre>
  <p>Error is not catched this way. Please guide how to get objc NSerror in above case.</p>
  <p>Note:  I can't use change objC method to 'Void' method to avoid throws translation because of enterprise scope of application.</p>