Invalid sample AnimatablePair warning
Hi there. Thanks for your work on DekKit. I'm seeing some warnings pop up in the console when running on device:
Invalid sample AnimatablePair<AnimatablePair<CGFloat, CGFloat>, AnimatablePair<CGFloat, CGFloat>>(first: SwiftUI.AnimatablePair<CoreGraphics.CGFloat, CoreGraphics.CGFloat>(first: -0.6666666666666643, second: 0.0), second: SwiftUI.AnimatablePair<CoreGraphics.CGFloat, CoreGraphics.CGFloat>(first: 0.0, second: 0.0)) with time Time(seconds: 0.0) > last time Time(seconds: 0.016677249979693443)
I can't diagnose the cause etc, but I wanted to let you know.
Did you email the wrong person? I’ve got no context for this issue. David Koontz Email: @.*** (360) 259-8380 http://about.me/davidakoontzOn Sep 8, 2024, at 2:06 AM, Gavin @.***> wrote: Hi there. Thanks for your work on DekKit. I'm seeing some warnings pop up in the console when running on device:
Invalid sample AnimatablePair<AnimatablePair<CGFloat, CGFloat>, AnimatablePair<CGFloat, CGFloat>>(first: SwiftUI.AnimatablePair<CoreGraphics.CGFloat, CoreGraphics.CGFloat>(first: -0.6666666666666643, second: 0.0), second: SwiftUI.AnimatablePair<CoreGraphics.CGFloat, CoreGraphics.CGFloat>(first: 0.0, second: 0.0)) with time Time(seconds: 0.0) > last time Time(seconds: 0.016677249979693443)
I can't diagnose the cause etc, but I wanted to let you know.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
Thank you @gavtron2000 - I see it too 🤔
I haven't seen it before, wonder if it's something new.
Other people seem to have it too:
https://www.reddit.com/r/SwiftUI/comments/1ekye64/anybody_know_what_the_invalid_sample_animatable/
https://stackoverflow.com/questions/77836428/swiftui-changing-view-position-with-drag-raises-ui-bug
https://github.com/aheze/SwipeActions/issues/22
Seems to be an underlying iOS bug.
Thanks @danielsaidi sorry I can't give any insight on how to fix it!
@gavtron2000 No worries, I'm just happy you notified me.
However, it might just be some iOS system logging that shouldn't be there. Do you see any strange behavior when using the deck component?
My client has noticed some crashing when swiping through the deck component, which I'm trying to isolate. There is a very real possibility it is being caused by my code, but I noticed the errors when trying to isolate the bug.
Perfect, let's keep this open in case we find something on our respective ends 👍
I'm not sure about the implementation here but in my case this bug came from changing a value on drag that affects an offset. I fixed it by using withAnimation for the new value. I had to make the animation linear and very fast otherwise it would be slow for my use case
The new DeckView version lets you customize the state change animation, so perhaps this is easier to investigate this now?