今天封裝afnet的時候遇到這個問題:Cannot convert value of type '(URLSessionDataTask, Error) -> Void' to expected argument type '((URLSessionDataTask?, Error) -> Void)?'
0圖片.png
大概意思就是我寫的這個閉包和afnet的類型不同
1圖片.png
研究之后改成這樣(加了個問號)
圖片.png
今天封裝afnet的時候遇到這個問題:Cannot convert value of type '(URLSessionDataTask, Error) -> Void' to expected argument type '((URLSessionDataTask?, Error) -> Void)?'
大概意思就是我寫的這個閉包和afnet的類型不同
研究之后改成這樣(加了個問號)