今天封装afnet的时候遇到这个问题:Cannot convert value of type '(URLSessionDataTask, Error) -> Void' to expected argument type '((URLSessionDataTask?, Error) -> Void)?'

大概意思就是我写的这个闭包和afnet的类型不同

研究之后改成这样(加了个问号)

今天封装afnet的时候遇到这个问题:Cannot convert value of type '(URLSessionDataTask, Error) -> Void' to expected argument type '((URLSessionDataTask?, Error) -> Void)?'
大概意思就是我写的这个闭包和afnet的类型不同
研究之后改成这样(加了个问号)
本文标题:闭包问题Cannot convert value of type
本文链接:https://www.haomeiwen.com/subject/njpzqxtx.html
网友评论