Hey prior to Swift 3 I previously used :
if CustomUser.sharedInstance.numberOfCredits > 0 {
}
Where numberOfCredits
is Double?
. Now I get the error: Binary operator '>' cannot be applied to operands of type 'Double?' and 'Int'. Why is this? So I change 0 to 0.0 and get Binary operator '>' cannot be applied to operands of type 'Double?' and 'Double'. Why doesn't this line work in Swift 3?