Here I am encoding my string but it gives an error stated above. What I had done is:
let plainData = (password)?.data(using: String.Encoding(rawValue: String.Encoding.utf8.rawValue))
let base64String = plainData.base64EncodedStringWithOptions(NSData.Base64EncodingOptions.init(rawValue: 0))
It gives me an error on the second line of code. If anyone can help!
You need to use base64EncodedString()
function of NSData.
let base64String = plainData?.base64EncodedString()
This works with Swift 3.0