A defer statement consists of a block of code, which will be executed when a function returns and should be used for cleanup.
As Swift's guard statements encourage a style of early return, many possible paths for a return may exist. A defer statement provides cleanup code, which then does not need ...