title: Conform to protocol in ViewController, in Swift
body: <p>Trying to conform to UITableViewDataSource and UITableViewDelegate inside a Swift UIViewController subclass.</p>
  <pre><code>class GameList: UIViewController {
  
      var aTableView:UITableView = UITableView()
  
      override func viewDidLoad() {
          super.viewDidLoad()
          aTableView.delegate = self
          aTableView.dataSource = self
          self.view.addSubview(aTableView)
          //errors on both lines for not conforming
      }
  
  }
  </code></pre>
  <p>Docs say you should conform on the <code>class</code> line after the <code>:</code> but that's usually where the superclass goes. Another <code>:</code> doesn't work. Using a comma separated list after the superclass also doesn't work</p>
  <h3>EDIT:</h3>
  <p>Also must adopt all required methods of each protocol, which I wasn't initially doing.</p>