Skip to content

Instantly share code, notes, and snippets.

View nperez0111's full-sized avatar
🤜
You know, doin' the do

Nick Perez nperez0111

🤜
You know, doin' the do
View GitHub Profile
@JeOam
JeOam / Base64.md
Last active August 19, 2019 18:20
Converting between Image and Base64 string in iOS

EDIT : In iOS7, you can use NSData's base64EncodedStringWithOptions

Now encode as:

- (NSString *)encodeToBase64String:(UIImage *)image {
 return [UIImagePNGRepresentation(image) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn];
}

Decode as: