title: Unable to use custom class in a protocol with @objc attribute?
body: <p>I am trying to create a protocol for JSON loading delegation, <code>JSONLoaderDelegate</code>. My other class, called <code>JSONLoader</code>, is supposed to dispatch events to its delegate (that implements the <code>JSONLoaderDelegate</code> protocol) like:</p>
  
  <pre><code>self?.delegate?.jsonLoaderdidEndWithError(self!, error: JSONLoaderError.LoadError)
  </code></pre>
  
  <p>The implementation of the JSONLoader is not that important (imho). However I seem to have problems to implement the protocol, this is the code:</p>
  
  <pre><code>@objc protocol JSONLoaderDelegate {
  
      optional func jsonLoaderdidBeginLoading(jsonLoader: JSONLoader)
      func jsonLoaderdidEndWithError(jsonLoader: JSONLoader, error: JSONLoader.JSONLoaderError)
      func jsonLoaderDidEndWithSuccess(jsonLoader: JSONLoader)
  
  }
  </code></pre>
  
  <p>This looks pretty straightforward to me but I am getting an error: </p>
  
  <blockquote>
    <p>method cannot be marked @objc because the type of the parameter cannot
    be represented in Objective-C.</p>
  </blockquote>
  
  <p>pointed to all three functions.</p>
  
  <p>Obviously, if I remove the <code>@objc</code> attribute I cannot use the <code>optional</code> for the function. I would really like to keep <code>jsonLoaderdidBeginLoading</code> as optional tho. Any ideas / ways to solve this? Thank you!</p>