onScroll modifier increase CPU usage from 30% to +90%
When I am using the onScroll modifier with a switch case there is a clear CPU problem that can even cause the UI to become laggy.
To Reproduce
-Single section ASCollectionView
-onScroll
-switch case on contentOffset.y
-switch case controls 2-3 State booleans
Expected behaviour
Maybe a 10-20% increase in CPU usage at most
onScroll modifier increase CPU usage from 30% to +90% When I am using the onScroll modifier with a switch case there is a clear CPU problem that can even cause the UI to become laggy.
To Reproduce -Single section ASCollectionView -onScroll -switch case on contentOffset.y -switch case controls 2-3 State booleans
Expected behaviour Maybe a 10-20% increase in CPU usage at most
onScroll Example
Xcode Version:
Simulator, Device, Both?