top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to conform to UITableViewDataSource and UITableViewDelegate inside a Swift UIViewController subclass.

0 votes
719 views

How to say to my view controller to use UITableViewDataSource and UITableViewDelegate

class listItems: UIViewController {

    var aTableView:UITableView = UITableView()

    override func viewDidLoad() {
        super.viewDidLoad()
        aTableView.delegate = self
        aTableView.dataSource = self
        self.view.addSubview(aTableView)
    }

}
posted Jul 16, 2014 by Arun

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

To conform protocols for class

  class listItems: UIViewController, UITableViewDataSource, UITableViewDelegate { }
answer Jul 17, 2014 by Raju
Similar Questions
+1 vote

How to declare single parameter which accept multiple values.

0 votes

I am facing situation to use external parameter name to a function parameter name .. How to achieve this

+1 vote

How to use default values for parameter in function. What will happens when value is not passed for a default parameters.

0 votes

Is it possible to set multiple return type for function in SWIFT. If yes please provide me syntax .

0 votes

How to set return type for function in SWIFT.

...