title: Base64 encode decode for image URL in Swift 3
body: <p>This is how  I encoded:</p>
  
  <pre><code>let url:NSURL = NSURL(string : pictURL)!
  let imageData : NSData = NSData.init(contentsOf: url as URL)!
  let str64 = imageData.base64EncodedData(options: .lineLength64Characters)
  // next line my code to save in core data just ignore it
  </code></pre>
  
  <p>The value for <code>encoded data = 3286 bytes</code>. I think it is wrong     </p>
  
  <pre><code>let pictEncoded = person.value(forKeyPath: "pictureurl") as! String
  
  if let imageData = Data(base64Encoded: pictEncoded, options: .ignoreUnknownCharacters),
         let image = UIImage(data: imageData)
      {
          cell.imgView.image = image
      }
  </code></pre>