can I check if downloaded image is corrupt or not before saving?

前端 未结 2 1074
孤街浪徒
孤街浪徒 2021-01-14 03:37

can I check if downloaded image is corrupt or not before saving it into my document directory? if yes then please tell me how? thank you

2条回答
  •  我在风中等你
    2021-01-14 04:32

    You could try to load the NSData object in a UIIImage with the initData. Then check if the return UIImage object is nil. This is not full proof methods, but should work.

提交回复
热议问题