title: Convert between UIImage and Base64 string
body: <p>Does anyone know how to convert a <code>UIImage</code> to a Base64 string, and then reverse it?</p>
  
  <p>I have the below code; the original image before encoding is good, but I only get a blank image after I encode and decode it.</p>
  
  <pre><code>NSData *imageData = UIImagePNGRepresentation(viewImage);
  
  NSString *b64EncStr = [self encode: imageData];
  
  NSString *base64String = [self encodeBase64:imageData];
  </code></pre>