Thread safety of UIImage

后端 未结 6 818
一整个雨季
一整个雨季 2020-12-31 19:43

I know that Apple officially recommends UIKit to be used in the main thread only. However, I\'ve also heard claims that UIImage is thread-safe since iOS 4.0. I cannot find

6条回答
  •  孤城傲影
    2020-12-31 20:27

    Just to make it short: UIImage is not thread safe, or better does only work on the main thread, as I have experienced in my current after some debugging.

    I hope that helps. I wish to have more clarity about this from Apple or even better an UIImage class, that could be rendered in a different thread. Shouldn't be too difficult ...

    edit: After some research, I found that it is "UIGraphicsGetImageFromCurrentImageContext();" that causes the trouble. it's a bit off the topic, but maybe this helps: https://coderwall.com/p/9j5dca

    Thanks to Zachary Waldowski.

提交回复
热议问题