Here I encode my string, but it gives the error mentioned above. I have done this:
let plainData = (password)?.data(using: String.Encoding(rawValue: String.Encoding.utf8.rawValue))
let base64String = plainData.base64EncodedStringWithOptions(NSData.Base64EncodingOptions.init(rawValue: 0))
This gives me an error in the second line of code. If someone can help!
source
share