Decode a base64 data to image

前端 未结 5 1822
广开言路
广开言路 2020-12-28 19:57

This code doesn\'t working with Swift 3 anymore.

imageData = NSData(base64EncodedString: mediaFile, options: NSDataBase64DecodingOptions.fromRaw(0)!)
         


        
5条回答
  •  -上瘾入骨i
    2020-12-28 20:17

    You can write like this way

    let data = NSData(base64Encoded: mediaFile, options: NSData.Base64DecodingOptions(rawValue: 0))
    

    Hope it will help you

提交回复
热议问题