Conforming to UITableViewDelegate and UITableViewDatasource in Swift?

后端 未结 2 991
野趣味
野趣味 2020-12-11 13:05

I am learning swift 2.0, and I was wondering if you still need to add the code tableView.datasource = self and tableView.delegate = self like in Ob

2条回答
  •  一个人的身影
    2020-12-11 13:46

    Yes, some assignment is still required.
    Either explicitly via code

    OR

    What you can do instead is connect them already in the interface builder, making the explicit assignment via code obsolete. That is probably what a lot of tutorials do.

提交回复
热议问题