I'm trying to compare inequality for a single case of my associated enum.
enum ResponseEnum {
case loading
case success(responseArray)
case failure(Error)
}
I can check if it is loading in a single line by writing:
if case .loading = myEnumVariable
However, I can't check for inequality in this way, I get this error: Variable binding in a condition requires an initializer
.
What does this error mean?
Is there a way to check for this inequality with a single line?