kentnguyen/KNSemiModalViewController

The screenshot cause a performance issue

wangshengjia opened this issue · 3 comments

Hi,

This problem is more obvious on the iPhone4 because the Retina display.

I run the test, it takes almost 1s to do the screenshot on iPhone4 which is inacceptable. We can cut down the scale factor like:
UIGraphicsBeginImageContextWithOptions(target.bounds.size, YES, [[UIScreen mainScreen] scale]/4.0f );

But that is not a good solution for me. Do you have the better idea?

Are you running the demo app or your own implementation? Yes, there are several factors that could affect the 'rendering' speed such as complexity of UI, the amount of computing your app does.

So far I have used the same technique of taking screenshot and blur it (UIImage+StackBlur) on all range of devices from 3GS but it seems ok.

Yes, on my own implementation. You are right, I agree with you.

I rerun the test with demo app, it's ok this time. So it must be the problem from complexity of UI as you mentioned. Actually, there are a lots of small subviews in my case (from 10 - 100). I am thinking about how can I optimize it. Thank you for your response.

I have had up to 20+ buttons but it's still acceptable. 100 is definitely too many.