How to convert Base64 string to NSData?
This works:
Swift 3, 4 & 5:
var data = Data(base64Encoded: recording_base64, options: .ignoreUnknownCharacters)
Swift 2:
var data = NSData(base64EncodedString: recording_base64, options: NSDataBase64DecodingOptions.IgnoreUnknownCharacters)
To convert from Base64 string to NSData
let nsd: NSData = NSData(base64EncodedString: Image, options: NSDataBase64DecodingOptions.IgnoreUnknownCharacters)!
To Convert to Blob
nsd.datatypeValue