jflinter / Dwifft

Swift Diff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues with Storyboards causing dwifft to update incorrectly.

jcampbell05 opened this issue · comments

I have an issue with the storyboard, I have a view model which exposes an array that powers a table view and it fetches and updates the calculator.

Unfortunatly as the table view loads from the storyboard things like set bounds reload the data and eventually the view model comes back with the data.

If it does it quickly enougth it crashes.

Why? Because a set bounds call could occur the same time the data is loaded.

So the table view reloads with the latest data and the network call also tries to tell the calculator to update it.

So what are some solutions:

  • A quick one is to compare the sizes of the section data to dwifft's and update, not sure how stable this is.
  • I directly use the rows property from the swifft calculator so I have the last data from when the table was last updated.

What do you think ?