trying to use AsyncdisplayKit for the 1st time in swift 3.
There is something that i do not understand :
i simply set up my ASviewController :
final class NodeFeedViewController: ASViewController<ASDisplayNode>, ASTableDataSource, ASTableDelegate {
var tableNode: ASTableNode {
return node as! ASTableNode
}
init() {
super.init(node: ASTableNode())
self.node.view.backgroundColor = UIColor.purple
self.node.backgroundColor = UIColor.yellow
self.tableNode.delegate = self
self.tableNode.dataSource = self
}
required init?(coder aDecoder: NSCoder) {
fatalError("storyboards are incompatible with truth and beauty")
}
Then i set up my ASTableNode :
func tableNode(tableNode: ASTableNode, nodeForRowAtIndexPath indexPath: NSIndexPath) -> ASCellNode {
let rowCount = 15
let node = ASTextCellNode()
node.text = String(format: "[%ld.%ld] says hello!", indexPath.section, indexPath.row)
return node
}
func numberOfSectionsInTableNode(tableNode: ASTableNode) -> Int {
return 1
}
func tableNode(tableNode: ASTableNode, numberOfRowsInSection section: Int) -> Int {
var count = 16
return count
}
Problem is that i compile because Xcode tells me that my controller does not conform to protocol 'ASCommon TableViewDataSource', the only way to make it work is to add the native :
/*
@available(iOS 2.0, *)
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}*
/
Any idea why it is not working on my project and that it's work on the swift example projet of AsyncdisplayKit ? Thanks for any help.