Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

convert image to base64 in swift ui

   func convertImageToBase64(image: UIImage) -> String? {
    let imageData = image.jpegData(compressionQuality: 1)
    return imageData?.base64EncodedString(options: 
    Data.Base64EncodingOptions.lineLength64Characters)
   }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #image #swift #ui
ADD COMMENT
Topic
Name
1+5 =