While converting from Swift 2.3 to 3.2 I received below error.
Error : Binary operator cannot be applied to operands of type Int and String
for this if Condition i.e if (error?.code)! == "-112"
which is shown in below line.
if (error?.code)! == "-112"
{
print("hello")
}
Error itself says it's different types Int
and String
.
You can need to typecast one or another in same form and them compare.
if (String(error?.code)!) == "-112"){
print("hello")
}