I am working on an image viewer application. I noticed some lag when scrolling and discovered this code to solve the problem:
https://gist.github.com/steipete/1144242
Basically, it just draws the UIImage, to preload/cache it, making the scrolling nice and smooth.
Is there anyway to detect whether a given UIImage is preloaded?
Asked at WWDC, there isn't a way to tell. So I used associated objects attached to my UIImage to track whether it was preloaded or not.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.