convert UIImage to NSData and back to UIImage

前端 未结 5 1495
难免孤独
难免孤独 2020-12-31 15:13

I have to populate table cell from database and images are on device. I\'ve to store that image in imageDataObject, how to convert that UIImage to

5条回答
  •  死守一世寂寞
    2020-12-31 15:28

    in Swift version:

        let imageData = UIImagePNGRepresentation(image!)!
        let imageFromData = UIImage(data: imageData)
    

提交回复
热议问题