Closed sedwo closed 5 years ago
This is generally caused when you don't have a dataSource set. Can you make sure that it is set and conforms to the SwiftGridViewDataSource protocol?
I understand. But programmatically I need to instantiate the SwiftGridView
object before I am able to set its delegates. And the crash occurs during the init process.
Crash example.
var gridDataSource = PrettyDataSource()
var gridDelegate = PrettyDelegate()
let prettyGridView = SwiftGridView(frame: CGRect(x: 0, y: 0, width: 500, height: 200)) // crash!
prettyGridView.delegate = gridDelegate
prettyGridView.dataSource = gridDataSource
My bad. I was trying to initialize everything inside a closure.
Good job on this control. 👍
Ah, good to have details on what situations cause errors. Thanks!