flowkey / UIKit-cross-platform

Cross-platform Swift implementation of UIKit, mostly for Android
MIT License
594 stars 40 forks source link

cleanup previous fix for velocity scroll animations #320

Closed michaelknoch closed 3 years ago

michaelknoch commented 3 years ago

Type of change: cleanup fix

Motivation (current vs expected behavior)

This change is based on the previous feedback of @ephemer in https://github.com/flowkey/UIKit-cross-platform/pull/319. Instead of exposing the static transactionStack we can also just check if there is an animation prototype defined in UIView.currentAnimationPrototype. If this value is defined, we are currently in a stack trace of an animation closure.

The fix for the velocity scroll is to cancel all animations only when setting the contentOffset not from within an animation closure.

Please check if the PR fulfills these requirements

codecov[bot] commented 3 years ago

Codecov Report

Merging #320 (f2b1bce) into master (c8abdd2) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #320   +/-   ##
=======================================
  Coverage   51.15%   51.15%           
=======================================
  Files          87       87           
  Lines        2895     2895           
=======================================
  Hits         1481     1481           
  Misses       1414     1414           
Impacted Files Coverage Δ
Sources/CATransaction.swift 78.57% <ø> (ø)
Sources/UIScrollView.swift 87.32% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c8abdd2...f2b1bce. Read the comment docs.