ios - Cannot show image converted in base64 -


i'm trying put base64 string image view i've tried in many ways not working, i'm doing first encode string base64, after i'm trying assign base64 in image when block of code finish line of code qrcodeimageview.image = image returns me nil, have idea of i'm doing wrong. in advance

class qrcodeviewcontroller: uiviewcontroller {

@iboutlet weak var qrcodeimageview: uiimageview!  var qrcodeconverted: string?  override func viewdidload() {     super.viewdidload()           print("qrcode", apimanager.sharedinstance.bas64 ?? "")      let longstring = apimanager.sharedinstance.qrcodee     let data = (longstring)?.data(using: string.encoding.utf8)     let base64 = data!.base64encodedstring(options: nsdata.base64encodingoptions(rawvalue: 0))      print("base64 ", base64)      if let decodeddata = data(base64encoded: base64, options: .ignoreunknowncharacters) {         let image = uiimage(data: decodeddata)         qrcodeimageview.image = image     } } 


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -