Despite all the methods I found on the internet. But it works through online translators.
For example, a method I tried:
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
}