Skip to content

Instantly share code, notes, and snippets.

@ratulSharker
Created April 11, 2018 06:29
Show Gist options
  • Save ratulSharker/5968e81bcdfdb8267312e0e1af26b2be to your computer and use it in GitHub Desktop.
Save ratulSharker/5968e81bcdfdb8267312e0e1af26b2be to your computer and use it in GitHub Desktop.
Extension for converting an UIImage into Base64 String
import UIKit
extension UIImage {
func base64EncodingString() -> String {
let imageData:Data = UIImagePNGRepresentation(self)!
return imageData.base64EncodedString()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment