konvajs中`drawFunc`和`sceneFunc`之间有什么区别?

时间:2018-05-21 06:14:36

标签: konvajs

我查看了ShapeLine。它们都有cellForRowAt:..,但class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { let arrayOne = [One(cellID: "1", name: "hello", lastName: "hello last", cellID2: "1"), One(cellID: "1", name: "hello", lastName: "hello last", cellID2: "1"), One(cellID: "1", name: "hello", lastName: "hello last", cellID2: "2"), One(cellID: "1", name: "hello", lastName: "hello last", cellID2: "1"), One(cellID: "1", name: "hello", lastName: "hello last", cellID2: "2"), One(cellID: "1", name: "hello", lastName: "hello last", cellID2: "1")] var filteredArray = [One]() @IBOutlet weak var compareTableView: UITableView! override func viewDidLoad() { super.viewDidLoad() // Here you apply your filter filteredArray = arrayOne.filter { $0.cellID == $0.cellID2 } } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return filteredArray.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "CompareTableViewCell") as! CompareTableViewCell let arrayID = filteredArray[indexPath.row] // Feed your cell return cell } } 在构造函数中有scensFunc个参数。

ShapedrawFunc之间有区别吗?为什么drawFunc在构造函数中有一个绘制函数对象?

1 个答案:

答案 0 :(得分:0)

不推荐使用

drawFunc并将其重命名为sceneFunc。所以只需使用sceneFunc