title: Swift protocol error: 'weak' cannot be applied to non-class type
body: <p>What's the difference between Protocols and class-bound Protocols, and which one we should use in Swift?</p>
  <pre><code>protocol A : class { ... }
  
  protocol A { ... }
  </code></pre>
  <p>We get an error when attempting to add a <code>weak</code> delegate when the Protocol is not defined as <code>: class</code>:</p>
  <pre><code>protocol A { ... }
  
  weak var delegate: A
  </code></pre>
  <p>Gives the error:</p>
  <blockquote>
  <p>'weak' cannot be applied to non-class type</p>
  </blockquote>
  <p>or</p>
  <blockquote>
  <p>'weak' must not be applied to non-class-bound 'A'; consider adding a protocol conformance that has a class bound</p>
  </blockquote>