set delegate and datasource of uitableview programmatically in Swift

后端 未结 2 1184
梦如初夏
梦如初夏 2021-01-16 21:29

I would like to set the delegate and datasource for \'tableViewinViewController.swift` file.

I wrote this code in my viewDidL

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-16 21:44

    Do this, it will work

    tableView.delegate      =   self
    tableView.dataSource    =   self
    

提交回复
热议问题