Can't get throws to work with function with completion handler
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to add a throws to my existing function with a completion handler but I keep getting a warning saying no calls throwing functions occur within try expression . In the section where I throw the errors, I get an error saying invalid conversion from throwing function of type '() throwing -> Void' to non-throwing function type. enum LoginError: ErrorType { case Invalid_Credentials case Unable_To_Access_Login case User_Not_Found } @IBAction func loginPressed(sender: AnyObject) { do{ try self.login3(dict, completion: { (result) -> Void