xmartlabs / Eureka

Elegant iOS form builder in Swift
https://eurekacommunity.github.io
MIT License
11.78k stars 1.33k forks source link

Show / Hidde row: Evaluate Hidden is called twice #2146

Open aluco100 opened 3 years ago

aluco100 commented 3 years ago

Hi there,

Recently I developed a functionality that shows a row within a string value. The code is following:

shippingPrice.hidden = Condition.function([], { (form) -> Bool in
                        print(!value.contains("Fijo"))
                        return !value.contains("Fijo")
                    })
shippingPrice.evaluateHidden()

However, the evaluateHidden's function is calling just twice. So appears and dissapears just twice, then it's not showing again and then crash with the following error:

'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (9) must be equal to the number of rows contained in that section before the update (9), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'

Can anybody help me with that?

Best Regards

mats-claassen commented 3 years ago

There seems to be a different error in your code, leading to that crash. With the code alone you posted that is hard to reproduce. Could you provide a snippet that produces this?

Also, in which context/function are you calling evaluateHidden? That might be the cause of the issue

Tulakshana commented 3 years ago

@aluco100 Is it safe to to assume that 'shippingPrice' is of type 'BaseRow'?