I have been trying to display large image from server, but I have to display it progressively.
I used subclass of UIView and in that I have taken UIImage
object, in which I used NSURLConnection and its delegate methods, I also used
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
in which I am appending data and converting it to UIImage
object, and drawing rect using the drawInRect:
method of UIImage
.
Everything is working fine, but the problem is, when image is being drawn on context, I cannot click anywhere else on screen until entire image is being drawn on to screen.
Is there any good solution, where I can click anywhere else even if image is being drawn on screen?
Any help will be appreciable.
Edit:
Is there any efficient way of drawing image blurry progressively in didReceiveData
? so drawInRect
does not take too much time to draw. Or If anyone has custom drawRect
method which efficiently displays image progressively as data received in didReceiveData
.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…