Since Apple decided to change error handling to a much more circuitous system, I'm having trouble updating a line of code in Xcode 7 and am getting an error I'm not familiar with.
I receive an error of: Argument type 'AnyObject.Protocol' does not conform to expected type 'AnyObject'
Here's my old code which used to work:
request.HTTPBody = NSJSONSerialization.dataWithJSONObject(params, options: nil, error: &err)
And my current code which is throwing the above error:
do {
request.HTTPBody = try NSJSONSerialization.dataWithJSONObject(obj: AnyObject, options: nil)
} catch let error as NSError {
print("Could not be completed due to \(error)")
}