Swift 3 base64解码返回零

时间:2016-11-03 08:48:53

标签: null base64 swift3 decode

尽管我在互联网上找到了所有方法。但它通过在线翻译工作。

例如,我尝试过的方法:

if let decodedData = NSData(base64Encoded: parts[1] as String, options:NSData.Base64DecodingOptions(rawValue: 0)),
                let decodedString = NSString(data: decodedData as Data, encoding: String.Encoding.utf8.rawValue) {

                print(decodedString)//Here we are getting decoded string
            }

0 个答案:

没有答案