KB Tag: Switch Cases

  • Switch Cases in Swift

    You’ve mainly likely heard of an if statement, consider of switch cases to be the more advanced form of a if. To begin a switch statement you inform Swift what variable you want to run things by, and then give the list of possible cases. Swift will get the case that matches your code first and then perform it then exit the switch. Here’s a simple example: let someNumber =…