Hello, I was wondering is someone would be able to help me. I’m working on an app where I have to add a button to the screen in code and this button muse move up with the tableView while simultaneously shift over to the right and stop at the navigationBar. The button also decreases its width. I used a UIViewPropertyAnimator to accomplish this.
Now due to how the screen is built, I can’t just add the button to the tableView and let the tableView handle the scrolling of the button when the user scrolls the content. Instead when the user pulls to refresh I move the button inside scrollViewDidScroll by simply changing the value of the button’s frame.origin.y when scrollView.contentOffset.y is smaller then 0. In the same delegate method I use the property animators fractionComplete property to scrub the animation with the scrollView.
My main issue seems to be that when the user abruptly scrolls the tableView up during a pull to fresh, the UIViewPropertyAnimator fires off correctly but the button sometimes stops a few points below the spot where it should stop at the end of the animation, sometimes it stops above that designated spot. Im not sure whats causing this.
Any help would highly appreciated. Thanks!