Konversi gambar ke base64 di Swift UI

   func convertImageToBase64(image: UIImage) -> String? {
    let imageData = image.jpegData(compressionQuality: 1)
    return imageData?.base64EncodedString(options: 
    Data.Base64EncodingOptions.lineLength64Characters)
   }
Depressed Dog