I'm working on a project and use alot of switch statements with a lot of cases and sometimes when editing, I am missing a curly brace somewhere and folding is an easy way to isolate the code and find the problem. Recently, I've noticed that the top-level switch statement will not fold. The cases underneath will fold just fine if there is code contained within two curly braces.
In the code below, the code between the top-level curly braces within the switch statement will not fold. However, the code within each case between the curly braces of the if statements will fold. Is this intended behavior for Xcode or is it a bug?
switch myVariableForSwitch
{
case "1st Case":
if firstCase == true
{
print("Do Something")
}
case "2nd Case":
if secondCase == true
{
print("Do Something Else")
}
default:
print("Do Nothing")
}