I have a simple switch-statement that is not that simple.
switch(bubble?.name){ //bubble is SKPhysicsBody
case "largeBubble": // <= error
newBubbleSize = "medium"
break;
default:
newBubbleSize = "large"
break;
}
Here I get error that I mentioned in title Binary operator '~=' cannot be applied to operands of type 'String' and 'String?'
. And I have no clue why it is a problem that one of them is an optional.
switch(bubble?.name ?? "unknown") { ... }
. – Brandish