I have been trying to write a simple function for adding two variables.
func add(X: Int?, Y: Int?) -> Int? {
guard let X != nil, Y != nil else
{ return nil }
return X + Y
}
I keep getting the following 2 error messages:
"Pattern matching in a condition requires the 'case' keyword"
and
"Variable binding in a condition requires an initializer"
Can someone help me fix this code?