nlampi / SwiftGridView

Swift based data grid view.
MIT License
58 stars 15 forks source link

SwiftGridViewDelegate: columnIndex returns erratic values #47

Closed sedwo closed 5 years ago

sedwo commented 5 years ago

When providing a simple grid data set, the delegate: func dataGridView(_ dataGridView: SwiftGridView, widthOfColumnAtIndex columnIndex: Int) -> CGFloat { returns column indeces that are outside the expected column range in the data, causing a Fatal error: Index out of range error.

image

nlampi commented 5 years ago

Hi @sedwo, can you provide more details around the dataSource used? I am having trouble recreating the issue stated here. Thanks!

sedwo commented 5 years ago

I'm just using your PrettyExample project to confirm this.

SwiftGridView-master.zip

sedwo commented 5 years ago

Hi @nlampi , just curious if you got a chance to check on this?

nlampi commented 5 years ago

Hi @sedwo, Sorry for the delay, I was able to look into and find the root cause for this issue. There were situations where the height was requested through size methods and the width was being ignored. This meant erratic values were being sent and widths that were being ignored were requested. These items were updated to explicitly request height only and now bypass this invalid width request (in v0.7.1). Let me know if you have any issues going forward. Thanks!

sedwo commented 5 years ago

Thank you!