[英]How to solve the error "Redundant conformance of viewController to protocol UIScrollViewDelegate in swift?
[英]Xcode 7 beta 5 Swift 2 redundant conformance to protocol error
我最近下載了Swift 2隨附的Xcode7。以下是我嘗試使我的類與UITableViewDataSource
和UITableViewDelegate
兼容的錯誤,它們在Xcode 6.2中運行良好,但在Xcode 7 beta 5中引發錯誤
class TableViewController: UITableViewController, UITableViewDataSource, UITableViewDelegate {
}
//錯誤:“ TableViewcontroller”與協議“ UITableViewDataSource”的冗余一致性
我已經在google上搜索了答案,但無法解決。
因為UITableViewController
已經符合,所以不需要指出您的TableViewController
符合這兩個協議。 因此,由於繼承,您的課程也將如此。
所有你需要的是:
class TableViewController: UITableViewController {
}
似乎Swift2比Swift更嚴格。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.