Closed kaunteya-suryawanshi closed 3 years ago
Yeah this, is an interesting one. Temporary fix is for you to use update.newValue
via temporary variable to do the new calculation. But a better and more systematic fix would be needed in the library.
@kaunteya-suryawanshi were you able to solve this?
@moyoteg
You can use the newValue which is received in the closure parameter instead of Defaults.xyz if possible. I was not able to use the value from closure parameter because the call to tableView(height:forRow)
is implicit when tableView.reloadData() is invoked.
Or you can even try
DispatchQueue.main.async {
// Your code that access Defaults.xyz
}
I have moved away from SwiftyUserDefauts, hence its difficult to recollect what solution I had use back then
Hey all. I just released 5.2.0 with the fix for that. Let me know if this helps - thanks!
I am using this library to store the
font size
of cells that are added to the TableViewWhenever the user increases the fontSize, I increment the value which eventually triggers the observer. Here is the code
Since I am reloading the tableView, it is invoking the heightForRow method which is required to determine the height of the cell
Now since height of the cells is proportional to the font size, I am doing this
Here on above line I am getting following error