Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Early Exits Using Guard7:01 with Pasan Premaratne
An early exit is a control flow concept where rather than checking for success cases first and worrying about errors last, you deal with the error case up front and exit the current scope. Swift allows us to do this using a guard statement in combination with optional binding and it allows for some really elegant code.