Loading UIImage in background thread causes ImageIO error

谁都会走 提交于 2019-12-03 04:05:42

UIKit is not a thread-safe class. Therefore, you should not call UIImage from the background.

Rather than create UIImages, render your images files into CGImageRefs. You can pass one of these back to the main thread and generate a UIImage from that (you will have still benefited by moving the heavy-lifting of image decompression to the background).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!