+ 1
can anyone explain fallthrough?!
4 Respostas
+ 3
fallthrough is used in switch in order to execute a case without checking its condition
+ 2
fallthrough is used to execute multiple cases.
for e.g if you are ib case 1 then in swift it will automatically return the control flow.
but if you want to execute case 1 then case 2 then you have to write fallthrough at end of case 1
+ 1
It just executes the line of code right below it.
0
fallthrough is used for executing the immediate next case it's like anti break keyword.
you can use fallthrough when you want multiple cases to get execute