Hello guys,
I'm new to programming and have just startet to my make first app.
In my code i have over 40 ''if' statments after each other, and was wondring if i should end each statement with ''return''.
After looking around online and reading some mixed answers, I was was hoping some of you could tell me if you would have used "return"? and why?
Eks:
if ranNumber == 1 { label.text = "text"; score += 1 }
else if ranNumber == 2 { label.text = "text"; score += 1 }
else if ranNumber == 3 { label.text = "text"; score += 1 }
.......
Ore should i throw away all the ''if'' statements, and take a diffrent approach to make it shorter? Any suggestions? (except from the switch statement)