I'm using Alamofire and after I do the fetch request I'm handling the error with:
guard case let .failure(error) = response.result else { return }
if let error = error as? AFError {
switch error {
...
}
}
Problem:
In line if let error = error as? AFError {
Xcode has a warning:
Conditional cast from 'AFError' to 'AFError' always succeeds
How can I Fix (preferred) or silence that warning?
I tried:
Removing it like this:
if let error = error {
but it says:
Initializer for conditional binding must have Optional type, not 'AFError'
Thanks