This code doesn't working with Swift 3 anymore.
imageData = NSData(base64EncodedString: mediaFile, options: NSDataBase64DecodingOptions.fromRaw(0)!)
So is this one.
imageData = NSData(base64EncodedString: mediaFile, options: .allZeros)
Instead of using NSData
use directly Swift 3 native Data
.
if let decodedData = Data(base64Encoded: mediaFile, options: .ignoreUnknownCharacters) {
let image = UIImage(data: decodedData)
}