title: Cannot assign a value of type to type UITableViewDataSource
body: <p>I am getting the following error when trying to assign the value of my table to self.</p>
  
  <pre><code>Cannot assign a value of type 'ActivityViewController' to a value of
  type 'UITableViewDataSource?'
  </code></pre>
  
  <hr>
  
  <p>The following lines of code are giving me the error above. I have looked on SO for other similar issues but found nothing with a table view. </p>
  
  <pre><code>class ActivityViewController: UIViewController, UITableViewDelegate, UITableViewDataSource
  </code></pre>
  
  <p>And in my viewDidLoad function</p>
  
  <pre><code>table.dataSource = self
  </code></pre>
  
  <ul>
  <li>I have tried cleaning and rebuilding the project. </li>
  <li>I have tried disconnecting the table from the view controller and re-connecting it as well with no luck. </li>
  </ul>
  
  <hr>
  
  <blockquote>
    <p>Full code:</p>
  </blockquote>
  
  <pre><code>class ActivityViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { // --&gt; Error here
  
      @IBOutlet var table: UITableView!
  
      var likersArray = [PFObject]()
  
      var username = ""
  
      func refresh() {
          var likersQuery = PFQuery(className: "Post")
          likersArray.removeAll(keepCapacity: true)
          likersQuery.orderByDescending("createdAt")
          likersQuery.findObjectsInBackgroundWithBlock { (likers, error) -&gt; Void in
              if let likers = likers as? [PFObject] {
                  self.likersArray = likers
                  self.table.reloadData()
              }
          }
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          let myBarColor = UIColor(red: 48/256, green: 72/256, blue: 95/256, alpha: 1.0)
          let view = UIView(frame: CGRect(x: 0.0, y: 0.0, width: UIScreen.mainScreen().bounds.size.width, height: 20.0))
          view.backgroundColor = myBarColor
          self.view.addSubview(view)
  
          refresh()
  
          table.dataSource = self // --&gt; Error here
  
  
      }
  </code></pre>