Swift 给UITableView 写extension 时 报错 does not conform to protocol 'UITableViewDataSource'

那是因为你没有实现 数据源和代理方法 实现下就好了  

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 0
    }


    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        return UITableViewCell()
    }

 

posted @ 2017-05-04 12:44  ZhangShengjie  阅读(2303)  评论(1编辑  收藏  举报