Swift 错误无法转换 '(AFHTTPRequestOperation?, AnyObject?) 类型的值 -> ()

Swift error Cannot convert value of type '(AFHTTPRequestOperation?, AnyObject?) -> ()

我更新xcode 8.0版(8A218a) swift 3后,我得到了这个错误

无法将类型“(AFHTTPRequestOperation?, AnyObject?) -> ()”的值转换为预期的参数类型“((AFHTTPRequestOperation?, Any?) -> Void)!”

这是上面显示错误的以下代码。

jsonmanager.post( "http://myapi.com",
                      parameters: nil,
                      success: { (operation: AFHTTPRequestOperation!,responseObject: AnyObject!) in
                        if(responseObject.object(forKey: "meta")?.object(forKey: "status")?.intValue == 200){....

我是不是做错了什么?

在之前的7.3.1版本中运行良好swift 2.

回调方法签名已更改。在 Swift 2 中是

(AFHTTPRequestOperation?, AnyObject?) -> Void

在 Swift 3 中是

(AFHTTPRequestOperation?, Any?) -> Void

您应该更改下面的行

success: { (operation: AFHTTPRequestOperation!,responseObject: AnyObject!)

success: { (operation: AFHTTPRequestOperation?, responseObject: Any?)