0

My app has a relatively expensive screen redraw. In its original form, we had the minimum zoom of the UIScrollview set to 100% and the max at 400% scaling, and in scrollViewDidEndZooming, we redraw the screen.

Our testers wrote up a bug that when the user continues to pinch beyond the minimum or maximum zoom levels, the screen still blinks since the expensive redraw is occurring in the background.

I attempted to fix this by checking (in scrollViewDidEndZooming) whether the scaling actually changed, and only do the content refresh if it did.

This, however, has caused a new problem: If the user (for example) starts at 100%, and in one gesture pinches up to 400%, then back down to 100%, the content will be slightly fuzzy. This is because my optimization sees the scaling as "didn't change", since it started and ended at 100%. But in reality the view is scaled up and back down, which results in the fuzz.

Ordinarily I would simply set a flag or something when the view went through those transitional scalings, but UIScrollView appears to not provide any such hooks - only a hook for beginning and ending scrolling.

Is there a way to accomplish what I'm trying to do, short of rolling my own gesture recognizers and forgoing the ones in UIScrollview, which seems overkill?

EDIT: I'm surprised others haven't run into this (or at least haven't responded as to how they deal with it). It seems like any app that has a relatively expensive redraw would run into either my "before" behavior, or the "after" behavior, neither of which is ideal with an expensive redraw situation. Thoughts?

RehcsifMit
  • 270
  • 1
  • 13

1 Answers1

0

Would disabling the UIScrollView bouncing help your problem? Or would this behavior affect your app?

ohr
  • 1,717
  • 14
  • 15