title: How to pass a Swift struct as a parameter to an Objective-C method
body: <p>I have an Objective-C method that accepts a parameter of type <code>id</code> and I want to pass it a Swift struct.</p>
  
  <p><code>ObjcClass.m</code> file:</p>
  
  <pre><code>@implementation ObjcClass
  + (void)addListener:(id)listener {
      // Do something with listener
  }
  </code></pre>
  
  <p><code>DemoStruct.swift</code> file:</p>
  
  <pre><code>struct DemoStruct {
      func registerAsListener() {
          ObjcClass.addListener(self) // Can't find a way to do this
      }
  }
  </code></pre>
  
  <p>The compile error message I get:</p>
  
  <blockquote>
    <p>Type 'DemoStruct' does not conform to protocol 'AnyObject'</p>
  </blockquote>
  
  <p>So my question would be, how do I make an Objective-C method accept <code>Any</code> instead of <code>AnyObject</code> and is there such a thing?</p>