UIImage to base64 String Encoding

后端 未结 7 1731
囚心锁ツ
囚心锁ツ 2020-12-01 01:04

How to convert UIimage to base64 encoded string? I couldn\'t find any examples or codes with detailed regarding.

7条回答
  •  甜味超标
    2020-12-01 01:12

    NSData (Base64) has changed slightly since the last reply in this thread.

    you should now use:

    NSData *base64EncodedImage = [UIImageJPEGRepresentation(img, 0.8) base64EncodingWithLineLength:0];
    

提交回复
热议问题