📜  在 swift ui 中将图像转换为 base64 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:02.184000             🧑  作者: Mango

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