Xcode 7 beta 5 Swift 2冗余符合协议错误

sam*_*att 7 ios xcode7 swift2

我最近下载了Swift 2附带的Xcode 7.以下是我尝试使用我的课程时遇到的错误 UITableViewDataSource,UITableViewDelegate它在Xcode 6.2中运行得非常好但在Xcode 7 beta 5中引发错误

class TableViewController: UITableViewController, UITableViewDataSource, UITableViewDelegate {
}
Run Code Online (Sandbox Code Playgroud)

//错误:'TableViewcontroller'与协议'UITableViewDataSource'的冗余一致性

我搜索谷歌的答案,但我无法得到它的解决方案.

rma*_*ddy 26

没有必要表明你TableViewController符合这两个协议,因为UITableViewController已经这样做了.因此,由于继承,你的班级也将如此.

所有你需要的是:

class TableViewController: UITableViewController {
}
Run Code Online (Sandbox Code Playgroud)

看起来Swift2比Swift更加严格.