title: Swift class add "@objc" for why
body: <p>Here's <a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Protocols.html#//apple_ref/doc/uid/TP40014097-CH25-XID_402" rel="nofollow">a link</a> to a Swift tutorial. </p>
  
  <p>I read the protocol section,i know if protocol is marked with the @objc:</p>
  
  <pre><code>@objc protocol CounterDataSource {
      optional func incrementForCount(count: Int) -&gt; Int
      optional var fixedIncrement: Int { get }
  }
  </code></pre>
  
  <p>this mean this protocol in order to specify optional requirements and can be adopted only by classes</p>
  
  <p>but tutorial didn't say why the class need to marked with the @objc too??</p>
  
  <pre><code>@objc class Counter {
      var count = 0
      var dataSource: CounterDataSource?
      func increment() {
        if let amount = dataSource?.incrementForCount?(count) {
          count += amount
        } else if let amount = dataSource?.fixedIncrement? {
          count += amount
        }
      }
  }
  </code></pre>
  
  <p>if i remove @objc from class , compiler didn't show error message too</p>
  
  <p>so what different between add @objc to class or not? </p>