Re: Binding to object returned by custom getter
Jack Brindle
I think I would have a property that holds the velocity that is calculated in response to the keyPathsForValues… method being fired.
toggle quoted message
Show quoted text
Then just bind to that property. Make sure that everything that is used to calculate velocity is included in the keyPathsForValues… method or this won’t work very well. It is permissible to use a method to do the calculating as it appears you have done, but you must call the willChange… and didChange… methods at the bingeing and end of the calculation in order for the KVO to succeed. You really cannot call the method just to get the value (it will fire the KVO, causing an infinite loop), which leads you right back to the method suggested above. - Jack On Jul 19, 2017, at 2:54 AM, Jonathan Taylor <jonathan.taylor@...> wrote: |
|