title: Swift 3: Understand syntax change for UITableViewDataSource method
body: <p>I have some questions with Swift 3 function calling. Below is an example.</p>
  
  <p>Old Swift:</p>
  
  <pre><code>func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -&gt; UITableViewCell
  </code></pre>
  
  <p>Swift 3:</p>
  
  <pre><code>func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell
  </code></pre>
  
  <p>That's fine with the above syntax. But now Xcode shows me an error and asks me to do like below:</p>
  
  <pre><code>@objc(tableView:cellForRowAtIndexPath:) func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell
  </code></pre>
  
  <p>I do not understand why I have to declare <code>@objc(tableView:cellForRowAtIndexPath:)</code>.</p>
  
  <p>This is happening only when I am trying to implement table view datasource methods under an extension. Also this is not happening for <code>numberOfRowsInSection</code> or <code>viewForHeaderInSection</code>.</p>
  
  <p>Can anyone help me to understand why this is happening?</p>